Make pthread test detect broke pthread join/detach behavior

This commit is contained in:
Kurt Zeilenga 2001-03-15 03:07:23 +00:00
parent fd41a199c0
commit a1a04f27f8

View file

@ -619,18 +619,22 @@ AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[
status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED); status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
if( status ) exit( status ); if( status ) exit( status );
#define ATTR &attr # define ATTR &attr
#elif defined( HAVE_PTHREADS_D4 )
# define ATTR pthread_attr_default
#else #else
#if HAVE_PTHREADS_D4 # define ATTR NULL
#define ATTR pthread_attr_default
#else
#define ATTR NULL
#endif
#endif #endif
/* make sure pthread_create() isn't just a stub */ /* make sure pthread_create() isn't just a stub */
status = pthread_create(&t, ATTR, task, NULL); status = pthread_create(&t, ATTR, task, NULL);
if( status ) exit( status ); 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 */ /* make sure pthread_detach() isn't just a stub */
#if HAVE_PTHREADS_D4 #if HAVE_PTHREADS_D4
status = pthread_detach( &t ); status = pthread_detach( &t );