Moved signal interfaces inside records
This commit is contained in:
@@ -21,7 +21,7 @@ type
|
||||
// Returns IMycState to await thread completion.
|
||||
// Exceptions within Proc are caught; the first one is stored
|
||||
// and can be re-raised in the main thread via WaitFor or Teardown.
|
||||
function CreateThread(const Proc: TProc): IMycState;
|
||||
function CreateThread(const Proc: TProc): TState.IState;
|
||||
|
||||
// Returns True if called from the main application thread.
|
||||
function InMainThread: Boolean;
|
||||
@@ -77,12 +77,12 @@ type
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
class function CreateAnonymousThread(const DbgName: String; const Proc: TProc): TThread;
|
||||
function CreateThread(const Proc: TProc): IMycState;
|
||||
function CreateThread(const Proc: TProc): TState.IState;
|
||||
procedure HandleException;
|
||||
procedure EnqueueJob(const Job: TProc);
|
||||
function Run(Job: TProc): IMycSubscriber;
|
||||
function CreateTask(const Gate: TState; const Proc: TProc): TSubscription;
|
||||
procedure WaitFor(State: IMycState);
|
||||
function CreateTask(const Gate: TState; const Proc: TProc): TSignal.TSubscription;
|
||||
procedure WaitFor(State: TState.IState);
|
||||
procedure Teardown;
|
||||
function InMainThread: Boolean;
|
||||
function InWorkerThread: Boolean;
|
||||
@@ -188,7 +188,7 @@ begin
|
||||
Result.NameThreadForDebugging(DbgName); // Set thread name for debugging
|
||||
end;
|
||||
|
||||
function TMycTaskFactory.CreateTask(const Gate: TState; const Proc: TProc): TSubscription;
|
||||
function TMycTaskFactory.CreateTask(const Gate: TState; const Proc: TProc): TSignal.TSubscription;
|
||||
begin
|
||||
if Gate.IsSet then
|
||||
begin
|
||||
@@ -201,9 +201,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMycTaskFactory.CreateThread(const Proc: TProc): IMycState;
|
||||
function TMycTaskFactory.CreateThread(const Proc: TProc): TState.IState;
|
||||
var
|
||||
res: IMycLatch;
|
||||
res: TLatch.ILatch;
|
||||
capturedProc: TProc;
|
||||
begin
|
||||
// Create a latch that will be signaled when the proc finishes
|
||||
@@ -345,7 +345,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMycTaskFactory.WaitFor(State: IMycState);
|
||||
procedure TMycTaskFactory.WaitFor(State: TState.IState);
|
||||
var
|
||||
lock: TSemaphore; // This is System.SyncObjs.TSemaphore
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user