Changeset 144 for MicroThreading/Demo/UMainForm.pas
- Timestamp:
- Jan 25, 2011, 2:16:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MicroThreading/Demo/UMainForm.pas
r142 r144 24 24 Button3: TButton; 25 25 Button4: TButton; 26 Button5: TButton; 27 Button6: TButton; 26 28 Label1: TLabel; 27 29 Label2: TLabel; … … 34 36 procedure Button3Click(Sender: TObject); 35 37 procedure Button4Click(Sender: TObject); 38 procedure Button5Click(Sender: TObject); 39 procedure Button6Click(Sender: TObject); 36 40 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 37 41 procedure FormCreate(Sender: TObject); … … 157 161 for I := 0 to SpinEdit1.Value do 158 162 Scheduler.AddMethod(Worker); 163 end; 164 165 procedure TForm1.Button5Click(Sender: TObject); 166 var 167 NewThread: TThread; 168 I: Integer; 169 begin 170 try 171 I := 0; 172 while True do begin 173 NewThread := TThread.Create(True); 174 NewThread.FreeOnTerminate:= False; 175 Inc(I); 176 end; 177 except 178 ShowMessage('Application can create ' + IntToStr(I) +' TThread instances'); 179 end; 180 end; 181 182 procedure TForm1.Button6Click(Sender: TObject); 183 begin 184 ShowMessage(IntToStr(GetThreadID)); 159 185 end; 160 186
Note:
See TracChangeset
for help on using the changeset viewer.