00001 #ifndef SEMAPHORE_H_
00002 #define SEMAPHORE_H_
00003
00004 #include "config.h"
00005
00006 #ifdef HAVE_LIBCOMMONCPP
00007 #include <cc++/thread.h>
00008 #else
00009 #include "semaphore.h"
00010 #endif
00011
00012 namespace dtn
00013 {
00014 namespace utils
00015 {
00016 #ifdef HAVE_LIBCOMMONCPP
00017 class Semaphore : public ost::Semaphore
00018 {
00019 public:
00020 Semaphore(unsigned int value = 0);
00021 ~Semaphore();
00022 };
00023 #else
00024 class Semaphore
00025 {
00026 public:
00027 Semaphore(unsigned int value = 0);
00028 ~Semaphore();
00029
00030 void wait();
00031 void post();
00032
00033 private:
00034 sem_t count_sem;
00035 };
00036 #endif
00037 }
00038 }
00039 #endif