TMutable
This commit is contained in:
@@ -36,7 +36,7 @@ type
|
||||
// Exceptions during Job execution are caught; the first one is stored
|
||||
// and can be re-raised in the main thread via WaitFor or Teardown.
|
||||
// Raises ETaskException if the factory is already terminated.
|
||||
function Run(Job: TProc): IMycSubscriber;
|
||||
function Run(Job: TProc): TSignal.ISubscriber;
|
||||
|
||||
procedure EnqueueJob(const Job: TProc);
|
||||
|
||||
@@ -80,7 +80,7 @@ type
|
||||
function CreateThread(const Proc: TProc): TState.IState;
|
||||
procedure HandleException;
|
||||
procedure EnqueueJob(const Job: TProc);
|
||||
function Run(Job: TProc): IMycSubscriber;
|
||||
function Run(Job: TProc): TSignal.ISubscriber;
|
||||
function CreateTask(const Gate: TState; const Proc: TProc): TSignal.TSubscription;
|
||||
procedure WaitFor(State: TState.IState);
|
||||
procedure Teardown;
|
||||
@@ -98,7 +98,7 @@ type
|
||||
implementation
|
||||
|
||||
type
|
||||
TMycPendingJob = class(TInterfacedObject, IMycSubscriber)
|
||||
TMycPendingJob = class(TInterfacedObject, TSignal.ISubscriber)
|
||||
private
|
||||
[volatile]
|
||||
FJob: TProc; // The job to execute when count reaches zero
|
||||
@@ -112,7 +112,7 @@ type
|
||||
property Owner: TMycTaskFactory read FOwner;
|
||||
end;
|
||||
|
||||
TMycTaskWait = class sealed(TInterfacedObject, IMycSubscriber)
|
||||
TMycTaskWait = class sealed(TInterfacedObject, TSignal.ISubscriber)
|
||||
private
|
||||
[volatile]
|
||||
FSemaphore: TSemaphore; // System.SyncObjs.TSemaphore to be released on notification
|
||||
@@ -303,7 +303,7 @@ begin
|
||||
TaskManager := nil;
|
||||
end;
|
||||
|
||||
function TMycTaskFactory.Run(Job: TProc): IMycSubscriber;
|
||||
function TMycTaskFactory.Run(Job: TProc): TSignal.ISubscriber;
|
||||
begin
|
||||
if FTerminated <> 0 then
|
||||
raise ETaskException.Create('Task factory terminated');
|
||||
|
||||
Reference in New Issue
Block a user