00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef WT_MOANING_H
00022 #define WT_MOANING_H
00023
00024 #ifdef __extern_c
00025 extern "C" {
00026 #endif
00027
00028 #include <pthread.h>
00029
00030 #ifdef __extern_c
00031 }
00032 #endif
00033
00034 #include <wefts_fastcond.h>
00035 #include <wefts_thread.h>
00036
00037 namespace Wefts {
00038
00122 class MoaningThread: public Thread
00123 {
00124
00125 private:
00127 bool m_canJoin;
00129 volatile int m_joiners;
00130
00131 protected:
00133 FastCondition m_cond;
00134
00142 int joiners() { return m_joiners; }
00143
00157 void blockJoiners();
00158
00159 public:
00161 MoaningThread();
00162
00176 void *join();
00177
00178
00191 virtual void cleanup();
00192
00193 };
00194
00195 }
00196
00197 #endif
00198