I use OmniThreadLibrary 2.09 in my dll, main application and dll are using the same SimpleShareMem
memory manager.
I created my own monitor with this code:
FMonitor: TOmniEventMonitor;
...
FMonitor := TOmniEventMonitor.Create(nil);
When I try to create a new task with this monitor, I'm getting an error "Task can be only monitored with a single monitor"
FTask := OtlTaskControl.CreateTask(TaskWorker)
.OnMessage(
procedure(const ATaskControl: IOmniTaskControl; const AMsg: TOmniMessage)
begin
...
end)
.MonitorWith(FMonitor) // <----- Error
.OnTerminated(
procedure (const ATaskControl: IOmniTaskControl)
begin
...
end)
.Run();
How can I monitor my task with my own monitor?