From a1a04f27f81fd379e954d7fa10036c5f49477eb0 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 15 Mar 2001 03:07:23 +0000 Subject: [PATCH] Make pthread test detect broke pthread join/detach behavior --- build/openldap.m4 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 ); -- 2.39.5