Fixed concurrent processing
This commit is contained in:
+19
-1
@@ -29,7 +29,10 @@ type
|
||||
|
||||
// Run a task when the gate is opened.
|
||||
// Returns a State to await thread completion.
|
||||
function RunTask(const Gate: TState; const Proc: TFunc<TState>): TState;
|
||||
function RunTask(const Proc: TFunc<TState>): TState; overload;
|
||||
function RunTask(const Gate: TState; const Proc: TFunc<TState>): TState; overload;
|
||||
procedure RunTask(const Gate: TState; const Proc: TProc); overload;
|
||||
procedure RunTask(const Proc: TProc); overload;
|
||||
|
||||
class function RunSequence(const Gate: TState; First, Count: Integer; const Proc: TFunc<Integer, TState>): TState; static;
|
||||
|
||||
@@ -181,6 +184,21 @@ begin
|
||||
);
|
||||
end;
|
||||
|
||||
function TTaskManager.RunTask(const Proc: TFunc<TState>): TState;
|
||||
begin
|
||||
Result := RunTask(TState.Null, Proc);
|
||||
end;
|
||||
|
||||
procedure TTaskManager.RunTask(const Proc: TProc);
|
||||
begin
|
||||
RunTask(TState.Null, Proc);
|
||||
end;
|
||||
|
||||
procedure TTaskManager.RunTask(const Gate: TState; const Proc: TProc);
|
||||
begin
|
||||
FTaskManager.RunTask(Gate, Proc);
|
||||
end;
|
||||
|
||||
procedure TTaskManager.WaitFor(const State: TState);
|
||||
begin
|
||||
FTaskManager.WaitFor(State);
|
||||
|
||||
Reference in New Issue
Block a user