On 08 Oct 2010, at 14:52, Graeme Geldenhuys wrote:

I thought about the timeout, and dived into the WaitFor code. So I
changed my code from.

   FThread.WaitFor;

..to...

   WaitForThreadTerminate(FThread.Handle, 2000);


The timeout parameter is ignored when using cthreads, because the pthreads API does not support waiting for a thread termination with a timeout.

Furthermore, the whole point of WaitFor() is to block the current execution thread from continuing until the thread has finished (it's a synchronisation point). If you just want to quickly check whether the thread has finished, check FThread.Finished (followed by FThread.Waitfor to clean it up in case it's true).


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to