On 05/12/2015 05:39 PM, Sven Barth wrote:

Why should that interfere in any kind?! Behind the scenes it's propably using TThread anyway...

Because Foreground code (here the calls made by the "visible" code the user creates to use "TParallel") and the "background code" in the threads that TParallel might create, communicate (i.e. the Thread notifying the foreground code about a state such as "ready") via the Event-Queue and for this the foreground code need to call CheckSynchronize().

But CheckSynchronize() needs to be "manually" done by the user in a pure FPC project. Only with projects using the LCL (or mse-gui or whatever framework), this is done without the user explicitly creating code for this.

How else should "SW.Stop;" in the example work ?

OK, "TStopWatch.Stop;" might call CheckSynchronize() in a loop with a timeout definable as a property of TStopWatch. This hopefully will not interfere with other CheckSynchronize() calls done e.g. by the LCL.

-Michael
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to