X-Spam-Check-By: sourceware.org Date: Wed, 12 Jul 2006 11:46:27 +0200 From: Corinna Vinschen 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Precedence: bulk List-Unsubscribe: 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 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/