IBR-DTNSuite  0.8
ibrcommon/ibrcommon/thread/Semaphore.h
Go to the documentation of this file.
00001 #ifndef IBRCOMMON_SEMAPHORE_H_
00002 #define IBRCOMMON_SEMAPHORE_H_
00003 
00004 #ifdef HAVE_SYS_SEMAPHORE_H
00005 #include <sys/semaphore.h>
00006 #else
00007 #include <semaphore.h>
00008 #endif
00009 
00010 namespace ibrcommon
00011 {
00012         class Semaphore
00013         {
00014                 public:
00015                         Semaphore(unsigned int value = 0);
00016                         virtual ~Semaphore();
00017 
00018                         void wait();
00019                         void post();
00020 
00021                 private:
00022                         sem_t count_sem;
00023         };
00024 }
00025 #endif /*SEMAPHORE_H_*/