24 #ifndef __IdleTaskThread__ 25 #define __IdleTaskThread__ 27 #include "IIdleTaskThread.h" 28 #include "HelperInterface.h" 30 # include <CoreServices/CoreServices.h> 96 namespace idt_syncprimitives{
97 class CIdleTaskThreadSyncPrimitives;
114 const static uint32 kCITT_Shutdown = 0x80000000;
120 virtual void InstallTask(uint32 millisecsBeforeFirstRun);
139 {
return ((fFlags & kCITT_Shutdown) != 0); }
156 virtual void RunThread(uint32 flags) = 0;
162 virtual uint32 StackSize();
166 typedef ThreadID ThreadHandle;
167 ThreadEntryUPP entryPoint;
169 typedef LPVOID ThreadHandle;
171 typedef int32 ThreadHandle;
173 # error CIdleTaskThread unimplemented 175 static const ThreadHandle kInvalidThreadHandle;
176 ThreadHandle fThisThread;
184 enum { kConstructed, kInstalled, kRunning, kYielding, kFinished, kDestroyed, kProcessingMainThreadTasks} fState;
188 void SwitchToChildThread();
189 void SwitchToParentThread();
193 static DEFINE_API(
void *) FiberEntryPoint(
void * cookie);
195 static void * FiberEntryPoint(
void * cookie);
197 static VOID CALLBACK CIdleTaskThread::FiberEntryPoint( PVOID cookie);
201 void FiberEntryPointNoReturn(
void* cookie);
203 idt_syncprimitives::CIdleTaskThreadSyncPrimitives* fSyncPrimitives;
208 #endif // __IdleTaskThread__