www.pudn.com > c++或C下如何使用多线程.zip > BaseThread.h
#if !defined(AFX_BASETHREAD_H__94B7CC05_AFE5_4FD4_887B_D3418F6995BA__INCLUDED_)
#define AFX_BASETHREAD_H__94B7CC05_AFE5_4FD4_887B_D3418F6995BA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BaseThread.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CBaseThread thread
class CBaseThread : public CWinThread
{
DECLARE_DYNCREATE(CBaseThread)
public:
CBaseThread(); // protected constructor used by dynamic creation
// Attributes
public:
static HANDLE m_hAnotherDead;
HANDLE m_hEventDead;
HANDLE m_hEventKill;
static CRITICAL_SECTION m_csNumLock;
static DWORD m_nCounter;
// Operations
public:
virtual void BeginProcess() = 0;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBaseThread)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CBaseThread();
// Generated message map functions
//{{AFX_MSG(CBaseThread)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BASETHREAD_H__94B7CC05_AFE5_4FD4_887B_D3418F6995BA__INCLUDED_)