[Lazarus] TThread.WaitFor blocks the main event loop under Linux

Marco van de Voort marcov at stack.nl
Fri Feb 17 17:04:27 CET 2012


On Thu, Oct 21, 2010 at 04:53:35PM +0200, Michael Schnell wrote:
> C program use appropriate header files that provide inline functions for 
> atomic. Same are "flavor-architecture specific", providing different 
> algorithms (with some sub-archs supported by Kernel tricks) to allow for 
> atomicness. When compiling an so library it can use the appropriate 
> header file (e.g. to do Futex).

That is all handcrafted hackery. Sure, you can do that with FPC too, if you
can get used to configure like tricks and preprocessors.
 
> Seemingly, to take advantage from this we could use libc to use  Futex 
> ("pthread_mutex()").

pthread_mutex is used by tbasicevent for ages. If pthreads maps futexes
under normal mutex if available, it should all work out of the box. (and
afaik already since 2.4.0)

IOW, just use syncobjs.




More information about the Lazarus mailing list