From: Kurt Zeilenga Date: Thu, 15 Mar 2001 04:21:25 +0000 (+0000) Subject: Update pthread detach/join test X-Git-Tag: OPENLDAP_REL_ENG_2_0_8~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e01e2272c2d1d4f0e88ee716f92be3a9c7792772;p=thirdparty%2Fopenldap.git Update pthread detach/join test --- diff --git a/build/openldap.m4 b/build/openldap.m4 index e6ce0d59dc..89b3e0fd51 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -619,18 +619,22 @@ AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[ status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED); if( status ) exit( status ); -#define ATTR &attr +# define ATTR &attr +#elif defined( HAVE_PTHREADS_D4 ) +# define ATTR pthread_attr_default #else -#if HAVE_PTHREADS_D4 -#define ATTR pthread_attr_default -#else -#define ATTR NULL -#endif +# define ATTR NULL #endif + /* make sure pthread_create() isn't just a stub */ status = pthread_create(&t, ATTR, task, NULL); if( status ) exit( status ); + /* give the thread a chance to complete... + * it should remain joinable and hence detachable + */ + sleep( 1 ); + /* make sure pthread_detach() isn't just a stub */ #if HAVE_PTHREADS_D4 status = pthread_detach( &t );