12345678910111213141516171819202122232425262728293031 |
- #include "StdAfx.h"
- #include "TestWorker.h"
- CTestWorker::CTestWorker(void):m_isBusy(false),m_task(0)
- {
- }
- CTestWorker::~CTestWorker(void)
- {
- }
- ServiceState CTestWorker::OnRunning( void )
- {
- ServiceState nextState = IService::OnRunning();
- if(nextState == pausing) return nextState;
- if(m_isBusy){
- m_task->run();
- m_isBusy=false;
- }else{
- Sleep(10);
- }
- return IService::OnRunning();
- }
- ServiceState CTestWorker::OnStarting( void )
- {
- m_isBusy=false;
- return running;
- }
|