| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * be found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 * NaCl Server Runtime mutex and condition variable abstraction layer. | 8 * NaCl Server Runtime mutex and condition variable abstraction layer. |
| 9 * The NaClX* interfaces just invoke the no-X versions of the | 9 * The NaClX* interfaces just invoke the no-X versions of the |
| 10 * synchronization routines, and aborts if there are any error | 10 * synchronization routines, and aborts if there are any error |
| 11 * returns. | 11 * returns. |
| 12 */ | 12 */ |
| 13 | 13 |
| 14 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SYNC_CHECKED_H_ | 14 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SYNC_CHECKED_H_ |
| 15 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SYNC_CHECKED_H_ | 15 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SYNC_CHECKED_H_ |
| 16 | 16 |
| 17 #include "native_client/src/include/nacl_base.h" | 17 #include "native_client/src/include/nacl_base.h" |
| 18 | 18 |
| 19 #include "native_client/src/shared/platform/nacl_sync.h" | 19 #include "native_client/src/shared/platform/nacl_sync.h" |
| 20 | 20 |
| 21 EXTERN_C_BEGIN | 21 EXTERN_C_BEGIN |
| 22 | 22 |
| 23 /* | 23 /* |
| 24 * These are simple checked versions of the nacl_sync API which will | 24 * These are simple checked versions of the nacl_sync API which will |
| 25 * abort on any unexpected return value. | 25 * abort on any unexpected return value. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 void NaClXMutexCtor(struct NaClMutex *mp); |
| 28 void NaClXMutexLock(struct NaClMutex *mp); | 29 void NaClXMutexLock(struct NaClMutex *mp); |
| 29 NaClSyncStatus NaClXMutexTryLock(struct NaClMutex *mp); | 30 NaClSyncStatus NaClXMutexTryLock(struct NaClMutex *mp); |
| 30 void NaClXMutexUnlock(struct NaClMutex *mp); | 31 void NaClXMutexUnlock(struct NaClMutex *mp); |
| 31 | 32 |
| 33 void NaClXCondVarCtor(struct NaClCondVar *cvp); |
| 32 void NaClXCondVarSignal(struct NaClCondVar *cvp); | 34 void NaClXCondVarSignal(struct NaClCondVar *cvp); |
| 33 void NaClXCondVarBroadcast(struct NaClCondVar *cvp); | 35 void NaClXCondVarBroadcast(struct NaClCondVar *cvp); |
| 34 void NaClXCondVarWait(struct NaClCondVar *cvp, | 36 void NaClXCondVarWait(struct NaClCondVar *cvp, |
| 35 struct NaClMutex *mp); | 37 struct NaClMutex *mp); |
| 36 | 38 |
| 37 NaClSyncStatus NaClXCondVarTimedWaitAbsolute( | 39 NaClSyncStatus NaClXCondVarTimedWaitAbsolute( |
| 38 struct NaClCondVar *cvp, | 40 struct NaClCondVar *cvp, |
| 39 struct NaClMutex *mp, | 41 struct NaClMutex *mp, |
| 40 struct nacl_abi_timespec const *abstime); | 42 struct nacl_abi_timespec const *abstime); |
| 41 | 43 |
| 42 NaClSyncStatus NaClXCondVarTimedWaitRelative( | 44 NaClSyncStatus NaClXCondVarTimedWaitRelative( |
| 43 struct NaClCondVar *cvp, | 45 struct NaClCondVar *cvp, |
| 44 struct NaClMutex *mp, | 46 struct NaClMutex *mp, |
| 45 struct nacl_abi_timespec const *reltime); | 47 struct nacl_abi_timespec const *reltime); |
| 46 | 48 |
| 47 EXTERN_C_END | 49 EXTERN_C_END |
| 48 | 50 |
| 49 #endif /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SYNC_CHECKED_H_ */ | 51 #endif /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SYNC_CHECKED_H_ */ |
| OLD | NEW |