Ignore:
Timestamp:
Jan 25, 2011, 2:16:25 PM (14 years ago)
Author:
george
Message:
  • Modified: Not finished implementation of multithreaded scheduler.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • MicroThreading/Demo/UMainForm.pas

    r142 r144  
    2424    Button3: TButton;
    2525    Button4: TButton;
     26    Button5: TButton;
     27    Button6: TButton;
    2628    Label1: TLabel;
    2729    Label2: TLabel;
     
    3436    procedure Button3Click(Sender: TObject);
    3537    procedure Button4Click(Sender: TObject);
     38    procedure Button5Click(Sender: TObject);
     39    procedure Button6Click(Sender: TObject);
    3640    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3741    procedure FormCreate(Sender: TObject);
     
    157161  for I := 0 to SpinEdit1.Value do
    158162    Scheduler.AddMethod(Worker);
     163end;
     164
     165procedure TForm1.Button5Click(Sender: TObject);
     166var
     167  NewThread: TThread;
     168  I: Integer;
     169begin
     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;
     180end;
     181
     182procedure TForm1.Button6Click(Sender: TObject);
     183begin
     184  ShowMessage(IntToStr(GetThreadID));
    159185end;
    160186
Note: See TracChangeset for help on using the changeset viewer.