This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: calling mutex_lock() twice from one thread


Bastian Voigt wrote:

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?

Yes, aside from the fact that you want non-recursive locks, semaphores are the _only_ synchronization primitive that can be used from inside signal handlers. Note that condition variables most definitely cannot be signalled from inside a signal handler - that will break - badly - on most unix platforms.


--
Will Bryant
Systems Architect, eCOSM.
Phone +64 3 365 4176 | Mobile +64 21 655 443
http://www.ecosm.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]