ServiceThread.h
资源名称:antinimda.zip [点击查看]
上传用户:leon2013
上传日期:2007-01-10
资源大小:186k
文件大小:1k
源码类别:
杀毒
开发平台:
Visual C++
- //////////////////////////////////////////////////////////////////////
- //
- // ServiceThread.h: interface for the CServiceThread class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_SERVICETHREAD_H__09E5CAF8_41F3_11D4_ACD1_0080C6F185C3__INCLUDED_)
- #define AFX_SERVICETHREAD_H__09E5CAF8_41F3_11D4_ACD1_0080C6F185C3__INCLUDED_
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- #include "Property.h"
- //all thread procedures have to be prepended with __cdecl()
- #define THREADPROC __cdecl
- class CServiceThread
- {
- public:
- CServiceThread(bool autostart=false);
- virtual ~CServiceThread();
- virtual bool Start();
- virtual bool Stop(bool wait=true);
- inline bool Running() const { return m_threadid>1; }
- inline bool StopPending() const { return m_threadid==1; }
- // parameter methods
- CServiceThread& operator+=(const Properties& parameters);
- CServiceThread& operator=(const Properties& parameters);
- protected:
- DWORD m_threadid;
- Properties m_parameters;
- // Overload this virtual function and provide your own
- // thread implementation.
- virtual void run();
- static void THREADPROC s_run(void* importobj);
- };
- #endif // !defined(AFX_SERVICETHREAD_H__09E5CAF8_41F3_11D4_ACD1_0080C6F185C3__INCLUDED_)