delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/07/12:47:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <clfuit00 AT fht-esslingen DOT de>
To: Robert Collins <robert DOT collins AT syncretize DOT net>, <cygwin AT cygwin DOT com>
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

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019