?? thread.cpp
字號:
//This piece of code has been written in University of Hull by
//Warren Viant then Head of Department
//in Department of Computer Science
//Some alteration have been made by me
#include "thread.h"
HANDLE Thread::start() {
unsigned threadId=0;
_hThread = (HANDLE)_beginthreadex(
NULL, // no security attributes (child cannot inherited handle)
1024*1024, // 1MB stack size
threadFunc, // code to run on new thread
this, // pointer to host application class
0, // run immediately (could create suspended)
&threadId // OUT: returns thread ID
);
return _hThread;
}
void Thread::waitForTermination() {
// wait for it to stop
_isRunning = false ;
WaitForSingleObject(_hThread, INFINITE);
// close thread handle
CloseHandle(_hThread);
_hThread=0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -