This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: calling mutex_lock() twice from one thread
- From: Nicolas EDEL <nedel at telisma dot com>
- To: Bastian Voigt <bastian at voigt dot in-berlin dot de>
- Cc: pthreads-win32 at sources dot redhat dot com
- Date: Mon, 15 Nov 2004 12:09:16 +0100
- Subject: Re: calling mutex_lock() twice from one thread
- Organization: Telisma
- References: <419888D2.firstname.lastname@example.org>
- Reply-to: nedel at telisma dot com
Bastian Voigt wrote:
according to the documentation pthread_mutex_lock() assigns the mutex to
the calling thread, and if a different thread calls it again it will be
In my scenario I want one thread to block itself, to be waked up later
by a signal handler. This does not work by simply calling mutex_lock()
twice, it does not block.
What can you recommend to achieve this? To be more concrete, I do the
The main thread loads some configuration, then starts some worker
threads. After the worker threads are running I want the main thread to
sleep until a signal (Ctrl-C) arrives. Will it work better when using
Thanks for any hints!
maybe you should have a look at the pthread_cond_t doc & usage.