Ignore:
Timestamp:
Jan 23, 2011, 7:25:13 PM (13 years ago)
Author:
george
Message:
  • Fixed: Switching micro thread using SP register only was not working. To switch method context BP register have to be switched too.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Microthreading/Demo/umainform.pas

    r133 r134  
    145145  I: Integer;
    146146begin
    147   //Memo1.Lines.Add('Work');
    148   //with MicroThread do
    149   //for I := 0 to 100 do begin
    150   //  Memo1.Lines.Add(InttoStr(Id) + ': ' + IntToStr(I));
    151     //Sleep(10);
    152   //  Yield;
    153   //end;
     147  with MicroThread do begin
     148    Memo1.Lines.Add('Worker ' + IntToStr(Id));
     149    for I := 0 to 10 do begin
     150      Memo1.Lines.Add(InttoStr(Id) + ': ' + IntToStr(I));
     151      SysUtils.Sleep(10 * Id);
     152      Yield;
     153    end;
     154  end;
    154155end;
    155156
Note: See TracChangeset for help on using the changeset viewer.