#ifndef __DSCThread_h__
#define __DSCThread_h__ 1
#include <DirectoryServiceCore/DSLThread.h>
#include <DirectoryServiceCore/PrivateTypes.h>
const SInt32 kEventPeriod = 60; const SInt32 kLongPeriod = 10; const SInt32 kShortPeriod = 5;
const UInt32 kMinPerHour = 60;
const UInt32 kSecondsPerMin = 60;
const UInt32 kMilliSecsPerSec = 1000;
const UInt32 kMicroSecsPerSec = 1000*1000;
const UInt32 kNanoSecPerSec = 1000*1000*1000;
const UInt32 kBadValue = 0xffffffff;
void ** const kThreadIgnoreResult = NULL;
class DSCThread : public DSLThread
{
public:
enum eSignature {
kTSUndefinedThread = '----',
kTSMigHandlerThread = 'mhdl',
kTSPlugInHndlrThread = 'pihn',
kTSSearchPlugInHndlrThread = 'sphn',
kTSMemberdKernelHndlrThread = 'mkhn',
kTSLauncherThread = 'lnch',
kTSNodeRegisterThread = 'ndrg',
kTSTCPListenerThread = 'tcpl',
kTSTCPConnectionThread = 'tcpc',
kTSPluginRunloopThread = 'prlt',
kTSLibinfoQueueThread = 'liqt'
};
enum eRunState {
kThreadRun = 0x00000000,
kThreadStop = 0x00000001,
kThreadWait = 0x00000002
};
DSCThread ( const UInt32 inThreadSig = 0 );
virtual ~DSCThread ( void );
public:
static UInt32 GetCurThreadRunState ( void );
static SInt32 Count ( void );
virtual UInt32 GetID ( void ) const;
virtual UInt32 GetSignature ( void ) const;
protected:
virtual void* Run ( void );
virtual SInt32 ThreadMain ( void ) = 0; virtual void LastChance ( void ) { }
virtual UInt32 GetThreadRunState ( void );
virtual void SetThreadRunState ( eRunState inState );
virtual void SetThreadRunStateFlag ( eRunState inStateFlag );
virtual void UnSetThreadRunStateFlag ( eRunState inStateFlag );
static SInt32 fStatThreadCount;
protected:
FourCharCode fThreadSignature;
private:
UInt32 fStateFlags;
};
#endif // __DSCThread_h__