Changeset 157 for MicroThreading/Demo/UMainForm.pas
- Timestamp:
- Jan 28, 2011, 7:33:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MicroThreading/Demo/UMainForm.pas
r156 r157 28 28 Label11: TLabel; 29 29 Label12: TLabel; 30 Label13: TLabel; 30 31 Label2: TLabel; 31 32 Label3: TLabel; … … 37 38 Label9: TLabel; 38 39 ListView1: TListView; 40 ListView2: TListView; 39 41 Memo1: TMemo; 40 42 PageControl1: TPageControl; … … 58 60 procedure FormShow(Sender: TObject); 59 61 procedure ListView1Data(Sender: TObject; Item: TListItem); 62 procedure ListView2Data(Sender: TObject; Item: TListItem); 60 63 procedure SpinEdit2Change(Sender: TObject); 61 64 procedure SpinEdit3Change(Sender: TObject); … … 240 243 end; 241 244 245 procedure TMainForm.ListView2Data(Sender: TObject; Item: TListItem); 246 begin 247 if Item.Index < MainScheduler.ThreadPoolCount then 248 try 249 MainScheduler.ThreadPoolLock.Acquire; 250 with TMicroThreadThread(MainScheduler.ThreadPool[Item.Index]) do begin 251 Item.Caption := IntToStr(ThreadID); 252 Item.SubItems.Add(MicroThreadThreadStateText[State]); 253 end; 254 finally 255 MainScheduler.ThreadPoolLock.Release; 256 end; 257 end; 258 242 259 procedure TMainForm.SpinEdit2Change(Sender: TObject); 243 260 begin … … 256 273 ListView1.Items[-1]; 257 274 ListView1.Refresh; 275 276 if ListView2.Items.Count <> MainScheduler.ThreadPoolCount then 277 ListView2.Items.Count := MainScheduler.ThreadPoolCount; 278 ListView2.Items[-1]; 279 ListView2.Refresh; 280 258 281 Label2.Caption := DateTimeToStr(NowPrecise) + ' ' + 259 282 FloatToStr(Frac(NowPrecise / OneSecond));
Note:
See TracChangeset
for help on using the changeset viewer.