From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13660 invoked by alias); 17 Nov 2004 06:11:47 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 13622 invoked from network); 17 Nov 2004 06:11:40 -0000 Received: from unknown (HELO serge.ecosm.com) (202.37.218.3) by sourceware.org with SMTP; 17 Nov 2004 06:11:40 -0000 Received: (qmail 1968 invoked by uid 503); 17 Nov 2004 06:11:37 -0000 Received: from sue.ecosm.com (HELO ?192.168.1.43?) (202.37.218.10) by serge.ecosm.com with SMTP; 17 Nov 2004 06:11:37 -0000 Message-ID: <419AEB9A.1060709@ecosm.com> Date: Wed, 17 Nov 2004 06:11:00 -0000 From: Will Bryant User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) MIME-Version: 1.0 To: Bastian Voigt , pthreads-win32@sources.redhat.com Subject: Re: calling mutex_lock() twice from one thread References: <419888D2.3060502@voigt.in-berlin.de> In-Reply-To: <419888D2.3060502@voigt.in-berlin.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004/txt/msg00144.txt.bz2 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/