home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1996 November
/
VPR9611B.ISO
/
vabasic
/
ntclnt.exe
/
DISK8
/
data.8
/
datab
/
INCLUDE
/
VTHREAD.HH
< prev
next >
Wrap
Text File
|
1996-07-29
|
4KB
|
112 lines
//==========================================================================//
// $Source: /rcs/crcs/general/vthread.hh,v $
// Checked in by: $Author: ej1 $
// $Date: 1996/06/10 21:32:23 $
// $Revision: 1.3 $
//--------------------------------------------------------------------------//
// //
// Copyright (c) 1995, Visual Edge Software Ltd. //
// //
// All rights reserved. This notice is intended as a precaution //
// against inadvertent publication, and shall not be deemed to con- //
// stitute an acknowledgment that publication has occurred nor to //
// imply any waiver of confidentiality. The year included in the //
// notice is the year of the creation of the work. //
// //
//----------------------------------------------------------------------------
// DESCRIPTION:
//
//==========================================================================//
#ifndef VTHREAD_HH
#define VTHREAD_HH
#include <visedge.hh>
#include <dllclass.hh>
#include <status.hh>
VCLASS VeThread;
//=========================================================================
// VTThreadFunction
// This type is a function pointer to a thread's function
//-------------------------------------------------------------------------
typedef void VFUNCPTR(VTThreadFunction)(VeThread *, void *);
//=========================================================================
// VTThreadState
// This enumeration is used to define the state of a thread
//-------------------------------------------------------------------------
typedef enum VTThreadStateEnum
{
kVThreadRunning, // The thread is in execution
kVThreadSuspended, // The thread is suspended an
// waiting for a condition to append
kVThreadStopped, // The thread has finished execution
kVThreadStopping // Internal type
} VTThreadState;
//=========================================================================
// VTThreadPriority
// This enumeration is used to define the differents priorities of a thread
//-------------------------------------------------------------------------
typedef enum VTThreadPriorityEnum
{
kVPriorityLow,
kVPriorityNormal,
kVPriorityHigh,
kVPriorityVeryHigh,
kVPriorityError
} VTThreadPriority;
//=========================================================================
//Include the files corresponding to the plateform
//-------------------------------------------------------------------------
#if defined(VSYS_WIN32) && defined(VSYS_MT)
//For Windows 32
#include "ntmt.hh"
#elif defined(VSYS_SOLARIS) && defined(VSYS_MT)
//For SunOs
#include "sunmt.hh"
#else
//Dummy classes with no MT support
#include "nomt.hh"
#endif
//=========================================================================
// Macros for using locks
//-------------------------------------------------------------------------
#define VETOKEN_CONCAT(a, b) a ## b
#define VETOKEN_PASS(a, b) VETOKEN_CONCAT(a, b)
#define VEUNIQUE_TOKEN(base) VETOKEN_PASS(base, __LINE__)
#define VEAUTONAME VEUNIQUE_TOKEN(__autolock)
#ifdef VSYS_MT
#define VELOCK
#define VELOCKDECL(name) VeLock name
#define VEEXTERNLOCKDECL(name) VDATADECL(VeLock) name
#define VEEXTERNLOCKDEF(name) VDATADEF(VeLock) name
#define VESTATICLOCKDECL(name) static VeLock name
#define VEAUTOLOCK(lock) VeAutoLock VEAUTONAME(lock)
#else
#define VENOOP() extern int VeNoOp
#define VELOCKDECL(name) VENOOP()
#define VEEXTERNLOCKDECL(name) VENOOP()
#define VEEXTERNLOCKDEF(name) VENOOP()
#define VESTATICLOCKDECL(name) VENOOP()
#define VEAUTOLOCK(lock) VENOOP()
#endif
#define VELOCK_BEGIN(lock) { VEAUTOLOCK(lock);
#define VELOCK_END }
#endif // VTHREAD_HH