Initial commit

This commit is contained in:
2026-06-12 23:18:12 +08:00
commit 424bde1b02
249 changed files with 40338 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "BaseThread.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
__fastcall TBaseThread::TBaseThread()
: TThread(true)
{
m_bWaiting = false;
m_hHaltSema = CreateSemaphore( NULL, 0, 1, NULL );
}
//---------------------------------------------------------------------------
__fastcall TBaseThread::~TBaseThread()
{
if( m_hHaltSema ){
CloseHandle( m_hHaltSema );
m_hHaltSema = NULL;
}
}
//---------------------------------------------------------------------------
bool __fastcall TBaseThread::Halt( DWORD dwMS )
{
if( int(dwMS)>0 ){
// m_bWaiting = true;
WaitForSingleObject( m_hHaltSema, dwMS );
// m_bWaiting = false;
}
return !Terminated;
}
//---------------------------------------------------------------------------
void __fastcall TBaseThread::Cancel(void)
{
Terminate();
Suspended = false;
ReleaseSemaphore( m_hHaltSema, 1, NULL );
}
//---------------------------------------------------------------------------