nfs-ganesha 1.4

SemN.h

Go to the documentation of this file.
00001 
00015 #ifndef TOOLS_H
00016 #define TOOLS_H
00017 
00018 #include <pthread.h>
00019 #include <semaphore.h>
00020 
00021 /*
00022  *  Synchronization features
00023  */
00024 
00025 typedef struct semaphore
00026 {
00027   sem_t semaphore;
00028 } semaphore_t;
00029 
00031 int semaphore_init(semaphore_t * sem, unsigned int value);
00033 int semaphore_destroy(semaphore_t * sem);
00034 
00036 void semaphore_P(semaphore_t * sem);
00038 void semaphore_V(semaphore_t * sem);
00039 
00040 #endif