|
//***********************************************************************
// (c) Copyright 1999-2003 Santronics Software, Inc. All Rights Reserved.
//***********************************************************************
// File Name : thread.h
// Subsystem : thread class
// Date : 03/03/2003
// Author : Hector Santos, Santronics Software, Inc.
// VERSION : 1.00P
//
// Revision History:
// Version Date Author Comments
// ------- -------- ------ -------------------------------------------
// v1.00P 03/03/03 HLS Public Release version
//***********************************************************************
#ifndef __THREAD_H
#define __THREAD_H
class CThread {
public:
CThread(DWORD startflags = 0);
virtual ~CThread();
void Start();
virtual void InitiateShutdown() { SetEvent(TerminateEvent); }
virtual void Stop();
virtual BOOL IsTerminated();
HANDLE GetThreadHandle() { return ThreadHandle; }
DWORD GetThreadId() { return tid; }
void SetShutdownWaitTime(const DWORD msecs) { ShutdownWaitTime = msecs;}
void SetStartFlags(const DWORD flags) { StartFlags = flags;}
protected:
DWORD ShutdownWaitTime;
HANDLE TerminateEvent;
virtual void Go() = 0;
private:
DWORD StartFlags;
HANDLE ThreadHandle;
DWORD tid;
static unsigned __stdcall ThreadRoutine(void *p);
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.