[fpc-devel] Threads and alot of crap

Marco van de Voort marcov at stack.nl
Tue Oct 17 11:53:43 CEST 2006


[ Charset ISO-8859-1 unsupported, converting... ]
> Jonas Maebe wrote:
> > Not sure if this means it's not necessary in the Mac OS X (and possibly 
> > FreeBSD) versions, or that the Mac OS X man pages are incomplete.
> 
> It does say: The pthread_cond_signal() function unblocks one thread 
> waiting for the condition variable cond.
> 
> By implication this means you need a mutex to protect against race 
> conditions. Those manual pages are incomplete/too concise I would say.

FreeBSD text for cond_wait:

DESCRIPTION
     The pthread_cond_wait() function atomically blocks the current thread
     waiting on the condition variable specified by cond, and unblocks the
     mutex specified by mutex.  The waiting thread unblocks only after
     another
     thread calls pthread_cond_signal(3), or pthread_cond_broadcast(3) with
     the same condition variable, and the current thread reacquires the lock
     on mutex.

The last line seems to say the same as Linux. 








More information about the fpc-devel mailing list