38
|
1 #ifndef SIMPLE_SEMAPHORE_H
|
|
2 #define SIMPLE_SEMAPHORE_H
|
|
3
|
|
4 #ifdef __cplusplus
|
|
5 extern "C" {
|
|
6 #endif
|
|
7
|
|
8
|
|
9 typedef struct SimpleSemaphore SimpleSemaphore;
|
|
10
|
|
11 SimpleSemaphore* SimpleSemaphore_CreateSemaphore(int initial_value);
|
|
12
|
|
13 void SimpleSemaphore_DestroySemaphore(SimpleSemaphore* simple_semaphore);
|
|
14
|
|
15 int SimpleSemaphore_SemaphoreTryWait(SimpleSemaphore* simple_semaphore);
|
|
16 int SimpleSemaphore_SemaphoreWait(SimpleSemaphore* simple_semaphore);
|
|
17 int SimpleSemaphore_SemaphoreGetValue(SimpleSemaphore* simple_semaphore);
|
|
18 int SimpleSemaphore_SemaphorePost(SimpleSemaphore* simple_semaphore);
|
|
19
|
|
20 /* Ends C function definitions when using C++ */
|
|
21 #ifdef __cplusplus
|
|
22 }
|
|
23 #endif
|
|
24
|
|
25 #endif
|
|
26
|