Search code examples
delphiomnithreadlibrary

How to handle IOmniParallelJoin finalization in OmniThreadLibrary?


I'm using IOmniParallelJoin to compute the several tasks in parallel with NoWait function because I want the GUI to stay responsive. But I also need to know when the computation is finished. Is there any event which is triggered in such case?


Solution

  • You can either use the OnStop function to inject some code or use a Task Configuration via TaskConfig and assign the code via OnTerminated. The difference is that OnStop is called inside one of the worker threads while OnTerminated is called inside the main thread.