mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-20 00:29:56 +00:00
Conditionalize use of pthread_mutexattr_setpshared() as this is an optional
POSIX feature from _POSIX_THREAD_PROCESS_SHARED group. Besides, Ulrich Drepper mentions "the kernel support for this option wasn't available until 2.5.7. Future versions of the thread library will support this option." <http://people.redhat.com/drepper/posix-option-groups.html> BTW, this nukes a warning when build on FreeBSD 4.6
This commit is contained in:
parent
7c1352a5f7
commit
ea98d02ce8
@ -135,6 +135,7 @@ fi
|
|||||||
AC_CHECK_FUNCS(pthread_cancel)
|
AC_CHECK_FUNCS(pthread_cancel)
|
||||||
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
|
||||||
AC_CHECK_FUNCS(pthread_mutexattr_settype)
|
AC_CHECK_FUNCS(pthread_mutexattr_settype)
|
||||||
|
AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
|
||||||
|
|
||||||
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
|
||||||
SEMSRC=
|
SEMSRC=
|
||||||
|
@ -803,7 +803,9 @@ struct B2_mutex {
|
|||||||
#if defined(HAVE_PTHREAD_MUTEXATTR_SETTYPE) && defined(PTHREAD_MUTEX_NORMAL)
|
#if defined(HAVE_PTHREAD_MUTEXATTR_SETTYPE) && defined(PTHREAD_MUTEX_NORMAL)
|
||||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_PTHREAD_MUTEXATTR_SETPSHARED
|
||||||
pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);
|
pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);
|
||||||
|
#endif
|
||||||
pthread_mutex_init(&m, &attr);
|
pthread_mutex_init(&m, &attr);
|
||||||
pthread_mutexattr_destroy(&attr);
|
pthread_mutexattr_destroy(&attr);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user