Skip to content
Snippets Groups Projects
Commit 5cf315c3 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Experimental support for GNU Pth's Posix Thread API. This might be a

suitable for systems with poor (or nonexistant) Pthread implementations.
parent 387186fc
No related branches found
No related tags found
No related merge requests found
...@@ -605,6 +605,27 @@ fi ...@@ -605,6 +605,27 @@ fi
]) ])
dnl dnl
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 Check LinuxThreads Header
dnl dnl
dnl defines ol_cv_header linux_threads to 'yes' or 'no' dnl defines ol_cv_header linux_threads to 'yes' or 'no'
......
This diff is collapsed.
...@@ -896,7 +896,7 @@ ol_link_threads=no ...@@ -896,7 +896,7 @@ ol_link_threads=no
if test $ol_with_threads = auto -o $ol_with_threads = yes \ if test $ol_with_threads = auto -o $ol_with_threads = yes \
-o $ol_with_threads = posix ; then -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 if test $ac_cv_header_pthread_h = yes ; then
OL_POSIX_THREAD_VERSION OL_POSIX_THREAD_VERSION
...@@ -915,6 +915,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \ ...@@ -915,6 +915,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
ol_with_threads=found ol_with_threads=found
OL_HEADER_LINUX_THREADS 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 Now the hard part, how to link?
dnl dnl
......
...@@ -126,13 +126,20 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo ) ...@@ -126,13 +126,20 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
int int
ldap_pvt_thread_yield( void ) 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(); return sched_yield();
#elif HAVE_PTHREAD_YIELD #elif HAVE_PTHREAD_YIELD
pthread_yield(); pthread_yield();
return 0; return 0;
#elif HAVE_THR_YIELD #elif HAVE_THR_YIELD
return thr_yield(); return thr_yield();
#else #else
return 0; return 0;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment