Changeset 5 for trunk/Platform/Base


Ignore:
Timestamp:
Nov 23, 2014, 9:04:03 AM (10 years ago)
Author:
chronos
Message:

#1

  • Fixed: Scheduler should stop all tasks if it is stopped.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        22ChronOS.lps
        33lib
         4heaptrclog.trc
  • trunk/Platform/Base/UPlatformBase.pas

    r4 r5  
    3232
    3333  TBaseScheduler = class(TScheduler)
    34     function AddTask(Name: string; EntryPoint: TBasicEvent): TTask; override;
     34    function AddTask(Name: string; EntryPoint: TTaskEvent): TTask; override;
    3535    constructor Create; override;
    3636    destructor Destroy; override;
     
    101101procedure TCustomThread.Execute;
    102102begin
    103   Task.EntryPoint;
     103  Task.EntryPoint(Task);
    104104end;
    105105
    106106{ TBaseScheduler }
    107107
    108 function TBaseScheduler.AddTask(Name: string; EntryPoint: TBasicEvent): TTask;
     108function TBaseScheduler.AddTask(Name: string; EntryPoint: TTaskEvent): TTask;
    109109var
    110110  Task: TBaseTask;
     
    135135
    136136procedure TBaseScheduler.Stop;
     137var
     138  I: Integer;
    137139begin
    138   inherited Start;
     140  inherited Stop;
     141  for I := 0 to Tasks.Count - 1 do
     142    TBaseTask(Tasks[I]).Terminated := True;
    139143end;
    140144
Note: See TracChangeset for help on using the changeset viewer.