mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-21 15:19:34 -05:00
Make pthread test detect broke pthread join/detach behavior
This commit is contained in:
parent
fd41a199c0
commit
a1a04f27f8
1 changed files with 10 additions and 6 deletions
|
|
@ -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 );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue