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:
Kurt Zeilenga 1999-08-21 17:19:10 +00:00
parent 387186fc33
commit 5cf315c31f
4 changed files with 503 additions and 397 deletions

View File

@ -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'

863
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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