27 lines
741 B
ObjectPascal
27 lines
741 B
ObjectPascal
unit Myc.TaskManager;
|
|
|
|
interface
|
|
|
|
uses
|
|
System.SysUtils,
|
|
Myc.Signals;
|
|
|
|
type
|
|
IMycTaskManager = interface
|
|
function CreateTask( const Gate: IMycState; const Proc: TProc ): TMycSubscription;
|
|
|
|
// 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);
|
|
end;
|
|
|
|
var
|
|
TaskManager: IMycTaskManager;
|
|
|
|
implementation
|
|
|
|
end.
|