You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to send a message to the main thread so I tried to set the EventMonitor from TaskConfig:
var
TaskConfig: IOmniTaskConfig;
Join: IOmniParallelJoin;
begin
Join := TOmniParallelJoin.Create;
Join.Task(...);
TaskConfig := Parallel.TaskConfig;
TaskConfig.MonitorWith(FGui.OmniEventMonitor);
Join.NumTasks(NumTasks).TaskConfig(TaskConfig).Execute;
end;
But an exception is raised from TOmniTaskControl.SetMonitor(hWindow: THandle): IOmniTaskControl; with the message Task can be only monitored with a single monitor.
Maybe taskControl.Unobserved; should only be called after checking that no monitor is assigned ?
What comes to my mind first: Can't you use the OnFinished handler? Otherwise check out the trick I did in my branch with DirectExecute in order to handle extra processing for arbitrary tasks: https://stackoverflow.com/questions/62327719/
I did a Pull request for this.
yann-papouin
added a commit
to yann-papouin/OmniThreadLibrary
that referenced
this issue
Jan 18, 2021
I need to send a message to the main thread so I tried to set the EventMonitor from TaskConfig:
But an exception is raised from
TOmniTaskControl.SetMonitor(hWindow: THandle): IOmniTaskControl;
with the messageTask can be only monitored with a single monitor
.Maybe
taskControl.Unobserved;
should only be called after checking that no monitor is assigned ?OmniThreadLibrary/OtlParallel.pas
Lines 2009 to 2011 in 721dc45
The text was updated successfully, but these errors were encountered: