/* pthread test function */
pthread_t t;
int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+ /* This system (e.g. AIX) defaults detached; must override */
+ pthread_attr_t attr;
- /* make sure pthread_create() isn't just a stub */
+ status = pthread_attr_init(&attr);
+ if( status ) exit( status );
+
+ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+ if( status ) exit( status );
+
+#define ATTR &attr
+#else
#if HAVE_PTHREADS_D4
- status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define ATTR pthread_attr_default
#else
- status = pthread_create(&t, NULL, task, NULL);
+#define ATTR NULL
#endif
-
+#endif
+ /* make sure pthread_create() isn't just a stub */
+ status = pthread_create(&t, ATTR, task, NULL);
if( status ) exit( status );
/* make sure pthread_detach() isn't just a stub */
])
])dnl
dnl ====================================================================
+dnl Check for NT Threads
+AC_DEFUN([OL_NT_THREADS], [
+ AC_CACHE_CHECK([for NT Threads], [ol_cv_nt_threads], [
+ AC_CHECK_FUNC(_beginthread,
+ [ol_cv_nt_threads=yes],
+ [ol_cv_nt_threads=no])
+ ])
+
+ if test $ol_cv_nt_threads = yes ; then
+ AC_DEFINE(HAVE_NT_THREADS,1,[if you have NT Threads])
+ fi
+])
+dnl ====================================================================
dnl Check LinuxThreads Header
dnl
dnl defines ol_cv_header linux_threads to 'yes' or 'no'