diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2012-01-01 15:56:28 +0100 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2012-01-01 15:56:28 +0100 |
| commit | e59b24d8db8a7a9ec21c654302d89e01903f4d96 (patch) | |
| tree | 26b38372e28f3c440f73c00ba60325a6c910726a /src/base/system.h | |
| parent | c31c82a5840640b0c7f4b07eb90e681b88b0a330 (diff) | |
| download | zcatch-e59b24d8db8a7a9ec21c654302d89e01903f4d96.tar.gz zcatch-e59b24d8db8a7a9ec21c654302d89e01903f4d96.zip | |
fixed atomics and semaphore for windows. can't test it correctly however due to that I only have a virtual box machine
Diffstat (limited to 'src/base/system.h')
| -rw-r--r-- | src/base/system.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/base/system.h b/src/base/system.h index aaa5b43f..ca93279f 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -388,6 +388,23 @@ int lock_try(LOCK lock); void lock_wait(LOCK lock); void lock_release(LOCK lock); + +/* Group: Semaphores */ + +#if defined(CONF_FAMILY_UNIX) + #include <semaphore.h> + typedef sem_t SEMAPHORE; +#elif defined(CONF_FAMILY_WINDOWS) + typedef void* SEMAPHORE; +#else + #error missing sempahore implementation +#endif + +void semaphore_init(SEMAPHORE *sem); +void semaphore_wait(SEMAPHORE *sem); +void semaphore_signal(SEMAPHORE *sem); +void semaphore_destroy(SEMAPHORE *sem); + /* Group: Timer */ #ifdef __GNUC__ /* if compiled with -pedantic-errors it will complain about long |