- dnl Check PREEMPTIVE Implementation
- if test $ol_with_preemptive = auto ; then
- AC_MSG_CHECKING([for preemptive Pthread implementation])
+ AC_MSG_CHECKING([if pthread_create() works])
+ AC_CACHE_VAL(ol_cv_pthread_create_works,[
+ AC_TRY_RUN([
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+ exit(pthread_create(&t, NULL, task, NULL));
+}
+],
+ [ol_cv_pthread_create_works=yes],
+ [ol_cv_pthread_create_works=no],
+ [dnl assume yes
+ ol_cv_pthread_create_works=yes])])
+ AC_MSG_RESULT($ol_cv_pthread_create_works)
+
+ if test $ol_cv_pthread_create_works = no ; then
+ AC_MSG_ERROR([pthread.h and pthread_create are not compatible])
+ fi
+
+ dnl Check if select causes an yield
+ if test $ol_with_yielding_select = auto ; then
+ AC_MSG_CHECKING([if select yields when using pthreads])
+ AC_CACHE_VAL(ol_cv_pthread_select_yields,[