public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* calling mutex_lock() twice from one thread
@ 2004-11-15 10:47 Bastian Voigt
  2004-11-15 11:09 ` Nicolas EDEL
  2004-11-17  6:11 ` Will Bryant
  0 siblings, 2 replies; 4+ messages in thread
From: Bastian Voigt @ 2004-11-15 10:47 UTC (permalink / raw)
  To: pthreads-win32

Dear list,

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 
blocked.

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 
following:

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 
semaphores?

Thanks for any hints!

Bastian Voigt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-17  7:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-15 10:47 calling mutex_lock() twice from one thread Bastian Voigt
2004-11-15 11:09 ` Nicolas EDEL
2004-11-17  6:11 ` Will Bryant
2004-11-17  7:51   ` Bastian Voigt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).