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 semaphore cross-platform abstraction
10 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SEMAPHORE_H_
11 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SEMAPHORE_H_
13 #include "native_client/src/include/nacl_base.h"
15 #include "native_client/src/shared/platform/nacl_sync.h"
18 #include "native_client/src/shared/platform/win/nacl_semaphore.h"
20 #include "native_client/src/shared/platform/linux/nacl_semaphore.h"
22 #include "native_client/src/shared/platform/osx/nacl_semaphore.h"
24 #error "Unknown platform!!!"
27 #include "native_client/src/shared/platform/nacl_sync.h"
33 int NaClSemCtor(struct NaClSemaphore *sem, int32_t value);
35 void NaClSemDtor(struct NaClSemaphore *sem);
37 NaClSyncStatus NaClSemWait(struct NaClSemaphore *sem);
39 NaClSyncStatus NaClSemTryWait(struct NaClSemaphore *sem);
41 NaClSyncStatus NaClSemPost(struct NaClSemaphore *sem);
43 int NaClSemGetValue(struct NaClSemaphore *sem);
47 #endif /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_SEMAPHORE_H_ */