?? active.cpp
字號:
#include "active.h"
//------------------------------------
// active.cpp
// Active object framework
// (c) Bartosz Milewski, 1996
//------------------------------------
// The constructor of the derived class
// should call
// _thread.Resume ();
// at the end of construction
ActiveObject::ActiveObject ()
: _isDying (0),
#pragma warning(disable: 4355) // 'this' used before initialized
_thread (ThreadEntry, this)
#pragma warning(default: 4355)
{
}
// FlushThread must reset all the events
// on which the thread might be waiting.
void ActiveObject::Kill ()
{
_isDying++;
FlushThread ();
// Let's make sure it's gone
_thread.WaitForDeath ();
}
DWORD WINAPI ActiveObject::ThreadEntry (void* pArg)
{
ActiveObject * pActive = (ActiveObject *) pArg;
pActive->InitThread ();
pActive->Run ();
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -