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.
8 * NaCl Server Runtime interruptible condvar, based on nacl_sync
9 * interface. We need a condvar that can handle interruptible mutexes
12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_INTERRUPTIBLE_CONDVAR_H_
13 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_INTERRUPTIBLE_CONDVAR_H_
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"
24 struct NaClIntrCondVar {
25 struct NaClCondVar cv;
28 int NaClIntrCondVarCtor(struct NaClIntrCondVar *cp);
30 void NaClIntrCondVarDtor(struct NaClIntrCondVar *cp);
32 NaClSyncStatus NaClIntrCondVarWait(struct NaClIntrCondVar *cp,
33 struct NaClIntrMutex *mp,
34 struct nacl_abi_timespec const *ts);
36 NaClSyncStatus NaClIntrCondVarSignal(struct NaClIntrCondVar *cp);
38 NaClSyncStatus NaClIntrCondVarBroadcast(struct NaClIntrCondVar *cp);
40 void NaClIntrCondVarIntr(struct NaClIntrCondVar *cp);
42 void NaClIntrCondVarReset(struct NaClIntrCondVar *cp);
47 #endif /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_INTERRUPTIBLE_CONDVAR_H_ */