PTHREAD_MUTEX_RECURSIVE on DragonFly is an enum.

SF Bug Tracker - ID: 3104527
Submitted: OBATA Akio ( obache ) - 2010-11-07 07:10:28 BRST

In threadutil/inc/ithread.h, it is expected that
PTHREAD_MUTEX_RECURSIVE is defined as macro. But on DragonFly BSD,
it is defined as enum, so not works as expected.

Attachment patch treat that DragonFly BSD always
have PTHREAD_MUTEX_RECURSIVE.
(cherry picked from commit ff006272b5cee2b02a50466db8a4b093880d3e76)
This commit is contained in:
Marcelo Roberto Jimenez 2010-11-07 11:49:33 -02:00
parent 8196092f50
commit 843b255518
2 changed files with 18 additions and 4 deletions

View File

@ -221,6 +221,20 @@ Version 1.8.0
Version 1.6.10 Version 1.6.10
******************************************************************************* *******************************************************************************
2010-11-07 Marcelo Roberto Jimenez <mroberto(at)users.sourceforge.net>
PTHREAD_MUTEX_RECURSIVE on DragonFly is an enum.
SF Bug Tracker - ID: 3104527
Submitted: OBATA Akio ( obache ) - 2010-11-07 07:10:28 BRST
In threadutil/inc/ithread.h, it is expected that
PTHREAD_MUTEX_RECURSIVE is defined as macro. But on DragonFly BSD,
it is defined as enum, so not works as expected.
Attachment patch treat that DragonFly BSD always
have PTHREAD_MUTEX_RECURSIVE.
2010-11-07 Marcelo Roberto Jimenez <mroberto(at)users.sourceforge.net> 2010-11-07 Marcelo Roberto Jimenez <mroberto(at)users.sourceforge.net>
ftime(3) in -lcompat should not be checked. ftime(3) in -lcompat should not be checked.

View File

@ -65,7 +65,7 @@ extern "C" {
#endif #endif
#ifdef PTHREAD_MUTEX_RECURSIVE #if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__)
/* This system has SuS2-compliant mutex attributes. /* This system has SuS2-compliant mutex attributes.
* E.g. on Cygwin, where we don't have the old nonportable (NP) symbols * E.g. on Cygwin, where we don't have the old nonportable (NP) symbols
*/ */
@ -336,7 +336,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Returns EINVAL if the kind is not supported. * Returns EINVAL if the kind is not supported.
* See man page for pthread_mutexattr_setkind_np * See man page for pthread_mutexattr_setkind_np
*****************************************************************************/ *****************************************************************************/
#ifdef PTHREAD_MUTEX_RECURSIVE #if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__)
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype #define ithread_mutexattr_setkind_np pthread_mutexattr_settype
#else #else
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np #define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
@ -361,7 +361,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
* Always returns 0. * Always returns 0.
* See man page for pthread_mutexattr_getkind_np * See man page for pthread_mutexattr_getkind_np
*****************************************************************************/ *****************************************************************************/
#ifdef PTHREAD_MUTEX_RECURSIVE #if defined(PTHREAD_MUTEX_RECURSIVE) || defined(__DragonFly__)
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype #define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
#else #else
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np #define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
@ -933,7 +933,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
#endif #endif
#ifndef PTHREAD_MUTEX_RECURSIVE #if !defined(PTHREAD_MUTEX_RECURSIVE) && !defined(__DragonFly__)
/* NK: Added for satisfying the gcc compiler */ /* NK: Added for satisfying the gcc compiler */
EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind); EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
#endif #endif