delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/12/05:46:47

X-Spam-Check-By: sourceware.org
Date: Wed, 12 Jul 2006 11:46:27 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Pthread.h issue
Message-ID: <20060712094627.GM8759@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <44B4289B DOT 1040105 AT niwa DOT co DOT nz>
Mime-Version: 1.0
In-Reply-To: <44B4289B.1040105@niwa.co.nz>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

On Jul 12 10:39, Mark Hadfield wrote:
> #if defined (PTHREAD_PRIO_INHERIT)
>   pthread_mutexattr_getprotocol(m_attr, &protocol);
>   POUT3(caller, protocol, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT, 
> PTHREAD_PRIO_NONE);
> #endif
> 
> This expands to valid C code if and only if the macros 
> PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT and PTHREAD_PRIO_NONE are 
> defined to integer constants. But the definitions are empty 
> (/usr/sys/sinclude/pthread.h, lines 63-65):
> 
> #define PTHREAD_PRIO_INHERIT
> #define PTHREAD_PRIO_NONE
> #define PTHREAD_PRIO_PROTECT
> [...]
> So, why would Cygwin pthread have empty definitions for these macros? Is 
> it safe to override the definitions? Would it be safer to omit the code 
> that uses them on this platform?

This looks like a leftover.  Mutex priorities are not supported
by Windows and nobody ever implemented it in Cygwin, so the corresponding
functions pthread_mutexattr_getprotocol and pthread_mutexattr_setprotocol
return with ENOSYS.  The above preprocessor test should better check for
_POSIX_THREAD_PRIO_INHERIT, which is the macro indicating that the
corresponding functionality is supported.

I will remove the above defines for the next Cygwin version. 

This implies that we would be glad if somebody would implement thread
priority inheritance in Cygwin.  http://cygwin.com/acronyms/#PTC


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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