00001 #ifndef CONDITIONAL_H_
00002 #define CONDITIONAL_H_
00003
00004 #include "config.h"
00005
00006 #ifdef HAVE_LIBCOMMONCPP
00007 #include <cc++/thread.h>
00008 #else
00009 #include <pthread.h>
00010 #endif
00011
00012 namespace dtn
00013 {
00014 namespace utils
00015 {
00016 #ifdef HAVE_LIBCOMMONCPP
00017 class Conditional : public ost::Conditional
00018 {
00019 public:
00020 Conditional();
00021 ~Conditional();
00022 };
00023 #else
00024 class Conditional
00025 {
00026 public:
00027 Conditional();
00028 ~Conditional();
00029
00030 void signal (bool broadcast = false);
00031 void wait ();
00032
00033 private:
00034 pthread_cond_t *m_cond;
00035 pthread_mutex_t *m_mutex;
00036 };
00037 #endif
00038 }
00039 }
00040
00041 #endif