mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Add check for pthread_yield().
Verify either sched_yield() or pthread_yield() exist if using POSIX Threads.
This commit is contained in:
parent
d376986c1e
commit
c0ec19cb69
15
configure.in
15
configure.in
@ -292,8 +292,17 @@ dnl AC_DEFINE(HAVE_LINUX_THREADS,1)
|
||||
fi
|
||||
|
||||
if test $ol_link_threads != no ; then
|
||||
dnl All POSIX Thread (final) implementations should have sched_yield
|
||||
AC_CHECK_FUNC(sched_yield)
|
||||
dnl All POSIX Thread (final) implementations should have
|
||||
dnl sched_yield instead of pthread yield.
|
||||
dnl check for both
|
||||
AC_CHECK_FUNCS(sched_yield pthread_yield)
|
||||
|
||||
if test $ac_cv_func_sched_yield = no -a \
|
||||
$ac_cv_func_pthread_yield = no ; then
|
||||
|
||||
AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
|
||||
AC_MSG_ERROR([POSIX Threads are not usable])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([could not link with POSIX Threads])
|
||||
fi
|
||||
@ -311,7 +320,7 @@ if test $ol_with_threads = manual ; then
|
||||
AC_MSG_WARN([thread defines and link options must be set manually])
|
||||
|
||||
AC_CHECK_HEADERS(pthread.h sched.h)
|
||||
AC_CHECK_FUNC(sched_yield)
|
||||
AC_CHECK_FUNCS(sched_yield pthread_yield)
|
||||
OL_LINUX_THREADS
|
||||
fi
|
||||
|
||||
|
@ -94,6 +94,12 @@
|
||||
/* Define if you have the mktime function. */
|
||||
#undef HAVE_MKTIME
|
||||
|
||||
/* Define if you have the pthread_yield function. */
|
||||
#undef HAVE_PTHREAD_YIELD
|
||||
|
||||
/* Define if you have the sched_yield function. */
|
||||
#undef HAVE_SCHED_YIELD
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#undef HAVE_SELECT
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user