Program C/C++

Class 내부 Thread basic...

HisPark 2013. 5. 10. 16:09

class MyClass
{
   
static DWORD WINAPI StaticThreadStart(void* Param)
   
{
       
MyClass* This = (MyClass*) Param;
       
return This->ThreadStart();
   
}

    DWORD
ThreadStart(void)
   
{
       
// Do stuff
   
}

   
void startMyThread()
   
{
       DWORD
ThreadID;
      
CreateThread(NULL, 0, StaticThreadStart, (void*) this, 0, &ThreadID);
   
}
};