Future<T> helper record

This commit is contained in:
Michael Schimmel
2025-06-02 14:27:00 +02:00
parent 48f4c945ce
commit e7e26f2a12
8 changed files with 1269 additions and 322 deletions
+1 -7
View File
@@ -41,13 +41,6 @@ type
// will be re-raised in the calling (main) thread.
procedure Teardown;
// Waits for the operation associated with State to complete.
// Must not be called from a worker thread of this factory.
// After waiting, or if the state is already set, any first stored exception
// from any worker thread of this factory will be re-raised in the calling (main) thread.
// Raises ETaskException if called from within a worker thread.
procedure WaitFor(State: IMycState);
// Gets the number of worker threads.
property ThreadCount: Integer read GetThreadCount;
end;
@@ -89,6 +82,7 @@ type
function InMainThread: Boolean;
function InWorkerThread: Boolean;
// Initialize global TaskManager
class procedure AquireTaskManager;
class procedure ReleaseTaskManager;
end;