semaphore.h

Go to the documentation of this file.
00001 
00014 #ifndef SEMAPHORE_H_
00015 #define SEMAPHORE_H_
00016 
00017 #include "malloc.h"
00018 #include "tqueue.h"
00019 #include "thread.h"
00020 
00021 struct semaphore {
00023         int value;           
00025         thread_queue_t  waiting_threads;
00027 };
00028 
00029 typedef struct semaphore semaphore_t;
00030 
00031 /* dont move to the top of the file, see previous declaration */
00032 
00033 void sem_init (struct semaphore * sem, const int value);
00034 void sem_destroy (semaphore_t * sem);
00035 int sem_get_value (semaphore_t * sem);
00036 void sem_up (semaphore_t * sem);
00037 void sem_down (semaphore_t * sem);
00038 int sem_down_timeout (semaphore_t * sem, const unsigned int usec);
00039 
00040 #endif /*SEMAPHORE_H_*/

Generated on Wed Nov 15 17:25:43 2006 for Kalisto by  doxygen 1.4.7