How can I use TTask.WaitForAny from the new threading library?
问题 In an attempt to use the threading library in Delphi to calculate tasks in parallel and using TTask.WaitForAny() to get the first calculated result, an exception occationally stopped the execution. Call stack at the exception: First chance exception at $752D2F71. Exception class EMonitorLockException with message 'Object lock not owned'. Process Project1.exe (11248) :752d2f71 KERNELBASE.RaiseException + 0x48 System.TMonitor.CheckOwningThread System.ErrorAt(25,$408C70) System.Error