Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / src / shared / platform / nacl_interruptible_condvar.h
1 /*
2  * Copyright 2008 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 /*
8  * NaCl Server Runtime interruptible condvar, based on nacl_sync
9  * interface. We need a condvar that can handle interruptible mutexes
10  * correctly.
11  */
12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_INTERRUPTIBLE_CONDVAR_H_
13 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_INTERRUPTIBLE_CONDVAR_H_
14
15 #include "native_client/src/include/nacl_base.h"
16 #include "native_client/src/shared/platform/nacl_interruptible_mutex.h"
17 #include "native_client/src/shared/platform/nacl_sync.h"
18 #include "native_client/src/trusted/service_runtime/include/sys/time.h"
19
20
21 EXTERN_C_BEGIN
22
23
24 struct NaClIntrCondVar {
25   struct NaClCondVar  cv;
26 };
27
28 int NaClIntrCondVarCtor(struct NaClIntrCondVar  *cp);
29
30 void NaClIntrCondVarDtor(struct NaClIntrCondVar *cp);
31
32 NaClSyncStatus NaClIntrCondVarWait(struct NaClIntrCondVar         *cp,
33                                    struct NaClIntrMutex           *mp,
34                                    struct nacl_abi_timespec const *ts);
35
36 NaClSyncStatus NaClIntrCondVarSignal(struct NaClIntrCondVar *cp);
37
38 NaClSyncStatus NaClIntrCondVarBroadcast(struct NaClIntrCondVar *cp);
39
40 void NaClIntrCondVarIntr(struct NaClIntrCondVar  *cp);
41
42 void NaClIntrCondVarReset(struct NaClIntrCondVar *cp);
43
44 EXTERN_C_END
45
46
47 #endif  /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_INTERRUPTIBLE_CONDVAR_H_ */