Add check for pthread_yield().

Verify either sched_yield() or pthread_yield() exist if using POSIX Threads.
This commit is contained in:
Kurt Zeilenga 1998-09-21 21:30:09 +00:00
parent d376986c1e
commit c0ec19cb69
3 changed files with 222 additions and 186 deletions

387
configure vendored

File diff suppressed because it is too large Load Diff

View File

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

View File

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