Subj : Re: redhat linux standard C library does not have pthread_mutex_trylock ??? To : comp.programming.threads From : Joe Seigh Date : Wed Feb 09 2005 07:15 am On 08 Feb 2005 19:40:04 -0800, Paul Pluzhnikov wrote: > "Joe Seigh" writes: > >> What do you think pthread_cond_wait is supposed to >> do in that case? > > Return EINVAL immediately? > No, that's not what EINVAL means. In a single threaded environment, pthread_cond_wait blocks forever or until it gets a spurious wakeup. You could code the libc stub version to be "{ return 0; }" but code properly written to handle spurious wakeups would loop on their condition test forever. The libc pthread stub routines are only meant to be used by libc functions that are aware of what part of the pthread api is supported as stubs. It's not a supported api for your use. -- Joe Seigh Lock-free synchronization primitives http://atomic-ptr-plus.sourceforge.net/ .