Initial
This commit is contained in:
30
thread/THREAD.BAK
Normal file
30
thread/THREAD.BAK
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <thread/thread.hpp>
|
||||
|
||||
WORD PureThread::start(LPVOID lpCreationData)
|
||||
{
|
||||
if(isOkay()||!mlpfnThreadProc)return FALSE;
|
||||
mhThread=::CreateThread((SECURITY_ATTRIBUTES*)0,InitialStack,mlpfnThreadProc,lpCreationData,CREATE_SUSPENDED,&mThreadID);
|
||||
if(!mhThread)return FALSE;
|
||||
mThreadStatus=InSuspend;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD PureThread::fatalThreadExit(void)
|
||||
{
|
||||
WORD returnCode(FALSE);
|
||||
|
||||
if(!isOkay())return returnCode;
|
||||
returnCode=::TerminateThread(mhThread,exitCode());
|
||||
mThreadStatus=InStop;mhThread=0;mThreadID=0;
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
DWORD PureThread::exitCode(void)const
|
||||
{
|
||||
DWORD exitCodeThread(0L);
|
||||
|
||||
if(!isOkay())return exitCodeThread;
|
||||
::GetExitCodeThread(mhThread,&exitCodeThread);
|
||||
return exitCodeThread;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user