00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CTHREAD_H
00016 #define CTHREAD_H
00017
00018 #include "IArchMultithread.h"
00019
00020 class IJob;
00021
00023
00039
00040 class CThread {
00041 public:
00043
00047 CThread(IJob* adoptedJob);
00048
00050
00054 CThread(const CThread&);
00055
00057
00062 ~CThread();
00063
00065
00066
00068
00073 CThread& operator=(const CThread&);
00074
00076
00088 static void exit(void*);
00089
00091
00116 void cancel();
00117
00119
00124 void setPriority(int n);
00125
00127
00131 void unblockPollSocket();
00132
00134
00135
00136
00138
00141 static CThread getCurrentThread();
00142
00144
00152 static void testCancel();
00153
00155
00165 bool wait(double timeout = -1.0) const;
00166
00168
00175 void* getResult() const;
00176
00178
00183 IArchMultithread::ThreadID
00184 getID() const;
00185
00187
00190 bool operator==(const CThread&) const;
00191
00193
00196 bool operator!=(const CThread&) const;
00197
00199
00200 private:
00201 CThread(CArchThread);
00202
00203 static void* threadFunc(void*);
00204
00205 private:
00206 CArchThread m_thread;
00207 };
00208
00209 #endif