// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Wclsync.pas' rev: 10.00

#ifndef WclsyncHPP
#define WclsyncHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Wclsync
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TwclSyncObject;
class PASCALIMPLEMENTATION TwclSyncObject : public System::TObject 
{
	typedef System::TObject inherited;
	
protected:
	__fastcall virtual TwclSyncObject(void);
public:
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TwclSyncObject(void) { }
	#pragma option pop
	
};


class DELPHICLASS TwclWaitableSyncObject;
typedef TwclWaitableSyncObject* *PwclWaitableSyncObject;

class PASCALIMPLEMENTATION TwclWaitableSyncObject : public TwclSyncObject 
{
	typedef TwclSyncObject inherited;
	
private:
	unsigned FHandle;
	
protected:
	__fastcall virtual TwclWaitableSyncObject(const unsigned Handle);
	virtual unsigned __fastcall WaitOne(void)/* overload */;
	virtual unsigned __fastcall WaitOne(const unsigned Timeout)/* overload */;
	
public:
	__fastcall virtual ~TwclWaitableSyncObject(void);
	/*         class method */ static unsigned __fastcall WaitAll(TMetaClass* vmt, const unsigned Count, const PwclWaitableSyncObject Objects)/* overload */;
	/*         class method */ static unsigned __fastcall WaitAll(TMetaClass* vmt, const unsigned Count, const PwclWaitableSyncObject Objects, const unsigned Timeout)/* overload */;
	/*         class method */ static unsigned __fastcall WaitAny(TMetaClass* vmt, const unsigned Count, const PwclWaitableSyncObject Objects)/* overload */;
	/*         class method */ static unsigned __fastcall WaitAny(TMetaClass* vmt, const unsigned Count, const PwclWaitableSyncObject Objects, const unsigned Timeout)/* overload */;
	__property unsigned Handle = {read=FHandle, nodefault};
};


class DELPHICLASS TwclNamedSyncObject;
class PASCALIMPLEMENTATION TwclNamedSyncObject : public TwclWaitableSyncObject 
{
	typedef TwclWaitableSyncObject inherited;
	
protected:
	__fastcall virtual TwclNamedSyncObject(const unsigned Handle);
	/*         class method */ static AnsiString __fastcall MakeUniqueName(TMetaClass* vmt, const AnsiString Name);
public:
	#pragma option push -w-inl
	/* TwclWaitableSyncObject.Destroy */ inline __fastcall virtual ~TwclNamedSyncObject(void) { }
	#pragma option pop
	
};


class DELPHICLASS TwclCriticalSection;
class PASCALIMPLEMENTATION TwclCriticalSection : public TwclSyncObject 
{
	typedef TwclSyncObject inherited;
	
private:
	_RTL_CRITICAL_SECTION FCS;
	
public:
	__fastcall virtual TwclCriticalSection(void);
	__fastcall virtual ~TwclCriticalSection(void);
	void __fastcall Enter(void);
	void __fastcall Leave(void);
};


class DELPHICLASS TwclMutex;
class PASCALIMPLEMENTATION TwclMutex : public TwclNamedSyncObject 
{
	typedef TwclNamedSyncObject inherited;
	
protected:
	__fastcall virtual TwclMutex(const unsigned Handle)/* overload */;
	
public:
	/*         class method */ static TwclMutex* __fastcall Create(TMetaClass* vmt)/* overload */;
	/*         class method */ static TwclMutex* __fastcall Create(TMetaClass* vmt, const AnsiString Name)/* overload */;
	/*         class method */ static TwclMutex* __fastcall Create(TMetaClass* vmt, const AnsiString Name, /* out */ bool &Exist)/* overload */;
	/*         class method */ static TwclMutex* __fastcall Open(TMetaClass* vmt, const AnsiString Name);
	unsigned __fastcall Acquire(void)/* overload */;
	unsigned __fastcall Acquire(const unsigned Timeout)/* overload */;
	bool __fastcall Release(void);
public:
	#pragma option push -w-inl
	/* TwclWaitableSyncObject.Destroy */ inline __fastcall virtual ~TwclMutex(void) { }
	#pragma option pop
	
};


class DELPHICLASS TwclEvent;
class PASCALIMPLEMENTATION TwclEvent : public TwclNamedSyncObject 
{
	typedef TwclNamedSyncObject inherited;
	
protected:
	__fastcall virtual TwclEvent(const unsigned Handle)/* overload */;
	
public:
	virtual unsigned __fastcall WaitOne(void)/* overload */;
	virtual unsigned __fastcall WaitOne(const unsigned Timeout)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset, const AnsiString Name)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset, const AnsiString Name, /* out */ bool &Exist)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Open(TMetaClass* vmt, const AnsiString Name);
	bool __fastcall ResetEvent(void);
	bool __fastcall SetEvent(void);
public:
	#pragma option push -w-inl
	/* TwclWaitableSyncObject.Destroy */ inline __fastcall virtual ~TwclEvent(void) { }
	#pragma option pop
	
};


class DELPHICLASS TwclAutoResetEvent;
class PASCALIMPLEMENTATION TwclAutoResetEvent : public TwclEvent 
{
	typedef TwclEvent inherited;
	
protected:
	__fastcall virtual TwclAutoResetEvent(const unsigned Handle)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset, const AnsiString Name)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset, const AnsiString Name, /* out */ bool &Exist)/* overload */;
	
public:
	/*         class method */ static TwclAutoResetEvent* __fastcall Create(TMetaClass* vmt)/* overload */;
	/*         class method */ static TwclAutoResetEvent* __fastcall Create(TMetaClass* vmt, const AnsiString Name)/* overload */;
	/*         class method */ static TwclAutoResetEvent* __fastcall Create(TMetaClass* vmt, const AnsiString Name, /* out */ bool &Exist)/* overload */;
public:
	#pragma option push -w-inl
	/* TwclWaitableSyncObject.Destroy */ inline __fastcall virtual ~TwclAutoResetEvent(void) { }
	#pragma option pop
	
};


class DELPHICLASS TwclManualResetEvent;
class PASCALIMPLEMENTATION TwclManualResetEvent : public TwclEvent 
{
	typedef TwclEvent inherited;
	
protected:
	__fastcall virtual TwclManualResetEvent(const unsigned Handle)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset, const AnsiString Name)/* overload */;
	/*         class method */ static TwclEvent* __fastcall Create(TMetaClass* vmt, const bool ManualReset, const AnsiString Name, /* out */ bool &Exist)/* overload */;
	
public:
	/*         class method */ static TwclManualResetEvent* __fastcall Create(TMetaClass* vmt)/* overload */;
	/*         class method */ static TwclManualResetEvent* __fastcall Create(TMetaClass* vmt, const AnsiString Name)/* overload */;
	/*         class method */ static TwclManualResetEvent* __fastcall Create(TMetaClass* vmt, const AnsiString Name, /* out */ bool &Exist)/* overload */;
public:
	#pragma option push -w-inl
	/* TwclWaitableSyncObject.Destroy */ inline __fastcall virtual ~TwclManualResetEvent(void) { }
	#pragma option pop
	
};


typedef unsigned TwclProcessId;

typedef unsigned TwclThreadId;

class DELPHICLASS TwclThread;
class PASCALIMPLEMENTATION TwclThread : public System::TObject 
{
	typedef System::TObject inherited;
	
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TwclThread(void) : System::TObject() { }
	#pragma option pop
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TwclThread(void) { }
	#pragma option pop
	
};


typedef int TwclThreadResult;

//-- var, const, procedure ---------------------------------------------------
static const unsigned WCL_WAIT_INFINITE = 0xffffffff;
static const Shortint WCL_WAIT_OBJECT_0 = 0x0;
static const Byte WCL_WAIT_ABANDONED_0 = 0x80;
static const Byte WCL_WAIT_ABANDONED = 0x80;
static const Word WCL_WAIT_TIMEOUT = 0x102;
static const unsigned WCL_WAIT_FAILED = 0xffffffff;
static const int WCL_WAIT_ERROR = -1;
static const Word WCL_STILL_ACTIVE = 0x103;
extern PACKAGE TwclProcessId __fastcall wclGetCurrentProcessId(void);
extern PACKAGE TwclThreadId __fastcall wclGetCurrentThreadId(void);
extern PACKAGE TwclThread* __fastcall wclCreateThread(const System::TThreadFunc Proc, const void * Param, /* out */ TwclThreadId &ThreadId)/* overload */;
extern PACKAGE TwclThread* __fastcall wclCreateThread(const System::TThreadFunc Proc, const void * Param, const bool Suspend)/* overload */;
extern PACKAGE TwclThread* __fastcall wclCreateThread(const System::TThreadFunc Proc, const void * Param)/* overload */;
extern PACKAGE void __fastcall wclResumeThread(TwclThread* Thread);
extern PACKAGE void __fastcall wclSuspendThread(TwclThread* Thread);
extern PACKAGE unsigned __fastcall wclGetThreadResult(const TwclThread* Thread);
extern PACKAGE void __fastcall wclWaitThread(const TwclThread* Thread);
extern PACKAGE void __fastcall wclCloseThread(TwclThread* &Thread);
extern PACKAGE void __fastcall wclWaitAndCloseThread(TwclThread* &Thread);

}	/* namespace Wclsync */
using namespace Wclsync;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Wclsync
