Skip to content
Snippets Groups Projects
Commit c939b0fb authored by rswindell's avatar rswindell
Browse files

Created a TList object to represent a shared resouce.

parent 9c9b1bc0
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
//---------------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment