mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Experimental support for GNU Pth's Posix Thread API. This might be a
suitable for systems with poor (or nonexistant) Pthread implementations.
This commit is contained in:
parent
387186fc33
commit
5cf315c31f
@ -605,6 +605,27 @@ fi
|
||||
])
|
||||
dnl
|
||||
dnl ====================================================================
|
||||
dnl Check GNU Pth pthread Header
|
||||
dnl
|
||||
dnl defines ol_cv_header linux_threads to 'yes' or 'no'
|
||||
dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
|
||||
dnl doesn't exists. Existance of pthread.h should separately
|
||||
dnl checked.
|
||||
dnl
|
||||
AC_DEFUN([OL_HEADER_GNU_PTH_PTHREAD_H], [
|
||||
AC_CACHE_CHECK([for GNU Pth pthread.h],
|
||||
[ol_cv_header_gnu_pth_pthread_h],
|
||||
[AC_EGREP_CPP(__gnu_pth__,
|
||||
[#include <pthread.h>
|
||||
#ifdef _POSIX_THREAD_IS_GNU_PTH
|
||||
__gnu_pth__
|
||||
#endif
|
||||
],
|
||||
[ol_cv_header_gnu_pth_pthread_h=yes],
|
||||
[ol_cv_header_gnu_pth_pthread_h=no])
|
||||
])
|
||||
])dnl
|
||||
dnl ====================================================================
|
||||
dnl Check LinuxThreads Header
|
||||
dnl
|
||||
dnl defines ol_cv_header linux_threads to 'yes' or 'no'
|
||||
|
@ -896,7 +896,7 @@ ol_link_threads=no
|
||||
if test $ol_with_threads = auto -o $ol_with_threads = yes \
|
||||
-o $ol_with_threads = posix ; then
|
||||
|
||||
AC_CHECK_HEADERS(pthread.h sched.h)
|
||||
AC_CHECK_HEADERS(pthread.h)
|
||||
|
||||
if test $ac_cv_header_pthread_h = yes ; then
|
||||
OL_POSIX_THREAD_VERSION
|
||||
@ -915,6 +915,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
|
||||
ol_with_threads=found
|
||||
|
||||
OL_HEADER_LINUX_THREADS
|
||||
OL_HEADER_GNU_PTH_PTHREAD_H
|
||||
|
||||
if test $ol_cv_header_gnu_pth_pthread_h = no ; then
|
||||
AC_CHECK_HEADERS(sched.h)
|
||||
fi
|
||||
|
||||
dnl Now the hard part, how to link?
|
||||
dnl
|
||||
|
@ -126,13 +126,20 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
|
||||
int
|
||||
ldap_pvt_thread_yield( void )
|
||||
{
|
||||
#ifdef HAVE_SCHED_YIELD
|
||||
#ifdef _POSIX_THREAD_IS_GNU_PTH
|
||||
sched_yield();
|
||||
return 0;
|
||||
|
||||
#elif HAVE_SCHED_YIELD
|
||||
return sched_yield();
|
||||
|
||||
#elif HAVE_PTHREAD_YIELD
|
||||
pthread_yield();
|
||||
return 0;
|
||||
|
||||
#elif HAVE_THR_YIELD
|
||||
return thr_yield();
|
||||
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user