mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 08:39:37 -05:00
We shouldn't detach a thread that we want to join with...
This commit is contained in:
parent
ca606823d4
commit
daaf487bdd
1 changed files with 7 additions and 0 deletions
|
|
@ -177,7 +177,10 @@ main( int argc, char **argv )
|
|||
|
||||
time( &starttime );
|
||||
pthread_attr_init( &attr );
|
||||
#ifdef DETACH_LISTENER_THREAD
|
||||
/* we should detach it if we're going to join with it */
|
||||
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_PTHREADS_D4)
|
||||
/* POSIX_THREADS or compatible
|
||||
|
|
@ -201,7 +204,11 @@ main( int argc, char **argv )
|
|||
}
|
||||
#endif /* !draft4 */
|
||||
pthread_attr_destroy( &attr );
|
||||
#ifdef HAVE_PHREADS_FINAL
|
||||
pthread_join( listener_tid, (void *) NULL );
|
||||
#else
|
||||
pthread_join( listener_tid, (void *) &status );
|
||||
#endif
|
||||
pthread_exit( 0 );
|
||||
} else {
|
||||
Connection c;
|
||||
|
|
|
|||
Loading…
Reference in a new issue