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/