From c939b0fba9fea535e6c664db5029fa68b2f6ea50 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Tue, 21 May 2002 10:36:41 +0000 Subject: [PATCH] Created a TList object to represent a shared resouce. --- src/xpdev/clx/ThreadCreate/MainUnit.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xpdev/clx/ThreadCreate/MainUnit.cpp b/src/xpdev/clx/ThreadCreate/MainUnit.cpp index 7989b3dae2..8bd7f07113 100644 --- a/src/xpdev/clx/ThreadCreate/MainUnit.cpp +++ b/src/xpdev/clx/ThreadCreate/MainUnit.cpp @@ -15,12 +15,14 @@ __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { CriticalSection = new TCriticalSection(); + List = new TList(); } //--------------------------------------------------------------------------- void __fastcall TForm1::CreateButtonClick(TObject *Sender) { TMyThread* NewThread = new TMyThread(true); + NewThread->List=List; NewThread->Log=Log; NewThread->CriticalSection = CriticalSection; ListBox->Items->AddObject(NewThread->ThreadID, NewThread); @@ -38,3 +40,9 @@ void __fastcall TForm1::KillButtonClick(TObject *Sender) } } //--------------------------------------------------------------------------- +void __fastcall TForm1::TimerTick(TObject *Sender) +{ + StatusBar->SimpleText = AnsiString(List->Count); +} +//--------------------------------------------------------------------------- + -- GitLab