1 #if !defined(_THREADMANAGER_H_) 2 #define _THREADMANAGER_H_ 4 #include "MemoryManager.h" 17 uint64 currentCPUTicks[10];
26 uint64 currentCPUTicks[10];
35 Runnable() {threadID = 0; shouldContinue =
true; isRunning =
false;}
39 virtual bool stop(uint32 timeout = 200) {
40 shouldContinue =
false;
41 int32 timeleft = (int32)timeout;
44 if ( (timeleft -= 5) <= 0) {
45 LogPrint(0,LOG_SYSTEM,0,
"Thread id %u didn't terminate...\n", threadID);
58 #define GETTHREADSTATS(data,id) (ThreadStats*)(data + sizeof(ThreadDataHeader) + ((ThreadDataHeader*)data)->bitFieldSize + id*sizeof(ThreadStats)) 65 static bool CreateThreadManager();
67 static bool CreateThread(THREAD_FUNCTION func,
void* args, uint32& newID, uint32 reqID = 0);
69 static bool PauseThread(uint32
id);
71 static bool ContinueThread(uint32
id);
73 static bool InterruptThread(uint32
id);
75 static bool TerminateThread(uint32
id);
77 static bool IsThreadRunning(uint32
id);
80 static bool AddLocalThreadStats();
82 static bool GetLocalThreadID(uint32&
id);
89 static ThreadStats* GetAllThreadStats(uint32& count);
92 static bool Shutdown();
99 int32 threadMonitoring();
103 bool createThread(THREAD_FUNCTION func,
void* args, uint32& newID, uint32 reqID);
105 bool pauseThread(uint32
id);
107 bool continueThread(uint32
id);
109 bool interruptThread(uint32
id);
111 bool terminateThread(uint32
id);
113 bool isThreadRunning(uint32
id);
116 bool addLocalThreadStats();
118 bool getLocalThreadID(uint32&
id);
126 bool resizeThreadStorage(uint32 newCount);
132 bool TestThreadManager();
134 static THREAD_RET THREAD_FUNCTION_CALL ThreadMonitoring(
void* arg);
139 #endif //_THREADMANAGER_H_
Definition: ThreadManager.h:33
Definition: ThreadManager.h:8
Definition: ThreadManager.h:60