thread.h
Go to the documentation of this file.00001
00002
00005 #ifndef THREAD_H
00006 #define THREAD_H
00007
00008 typedef void (*OTTDThreadFunc)(void *);
00009
00010 class OTTDThreadExitSignal { };
00011
00015 class ThreadObject {
00016 public:
00020 virtual ~ThreadObject() {};
00021
00025 virtual bool Exit() = 0;
00026
00030 virtual void Join() = 0;
00031
00040 static bool New(OTTDThreadFunc proc, void *param, ThreadObject **thread = NULL);
00041 };
00042
00046 class ThreadMutex {
00047 public:
00048 static ThreadMutex *New();
00049
00053 virtual ~ThreadMutex() {};
00054
00058 virtual void BeginCritical() = 0;
00059
00063 virtual void EndCritical() = 0;
00064 };
00065
00066 #endif