Refactoring

This commit is contained in:
Michael Schimmel
2025-06-03 18:20:02 +02:00
parent 561a3c6bb5
commit 556690fa5e
12 changed files with 152 additions and 155 deletions
+3 -4
View File
@@ -76,7 +76,7 @@ type
procedure HandleException;
procedure EnqueueJob(const Job: TProc);
function Run(Job: TProc): IMycSubscriber;
function CreateTask(const Gate: IMycState; const Proc: TProc): TMycSubscription;
function CreateTask(const Gate: TState; const Proc: TProc): TState.TSubscription;
procedure WaitFor(State: IMycState);
procedure Teardown;
function InMainThread: Boolean;
@@ -183,10 +183,9 @@ begin
Result.NameThreadForDebugging(DbgName); // Set thread name for debugging
end;
function TMycTaskFactory.CreateTask(const Gate: IMycState; const Proc: TProc):
TMycSubscription;
function TMycTaskFactory.CreateTask(const Gate: TState; const Proc: TProc): TState.TSubscription;
begin
if not Assigned(Gate) or Gate.IsSet then
if Gate.IsSet then
begin
EnqueueJob( Proc );
end