Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sun, 7 Jul 2002 18:46:30 +0200 (CEST) From: Clemens Fuchslocher To: Robert Collins , Subject: Re: 1.3.12: pthread mutex - second lock won't block. In-Reply-To: <025001c2254b$393c6730$1800a8c0@LAPTOP> Message-ID: <6460207071333550-100000@foo> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 7 Jul 2002, Robert Collins wrote: > Cygwin's default pthread mutex type is RECURSIVE. And the pthread > mutex attribute calls will reject any 'normal' or 'errorchecking' > mutex type requests. It's fully in the pthread spec is this regard. So I can only use the PTHREAD_MUTEX_RECURSIVE type under cygwin? I have test it with the following source fragment. And it will cause a 'pthread_mutexattr_settype: Invalid argument' message. Only PTHREAD_MUTEX_RECURSIVE will work. Oops, ok. :) -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= [...] pthread_mutexattr_t attr; if ((ret = pthread_mutexattr_init (&attr)) != 0) { printf ("pthread_mutexattr_init: %s\n", strerror (ret)); return EXIT_FAILURE; } if ((ret = pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_NORMAL)) != 0) { printf ("pthread_mutexattr_settype: %s\n", strerror (ret)); return EXIT_FAILURE; } [...] -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= > If your application is assuming that the default mutex type is > non recursive, it is a bug in your code. Yes, I have assumed that. Thank you! -- :) -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/