From: Howard Chu Date: Sat, 27 Jul 2002 00:12:39 +0000 (+0000) Subject: Additional tweak for HAVE_PTHREADS_OS390 X-Git-Tag: NO_SLAP_OP_BLOCKS~1322 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f969443fb7d45765920453d45f1729b628562193;p=openldap Additional tweak for HAVE_PTHREADS_OS390 --- diff --git a/libraries/libldap_r/thr_posix.c b/libraries/libldap_r/thr_posix.c index 847e727010..fef18fe9ca 100644 --- a/libraries/libldap_r/thr_posix.c +++ b/libraries/libldap_r/thr_posix.c @@ -97,7 +97,7 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread, #ifdef PTHREAD_CREATE_DETACHED } else { pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); -#elif HAVE_PTHREAD_OS390 +#elif HAVE_PTHREADS_OS390 } else { int st = __DETACHED; pthread_attr_setdetachstate(&attr, &st); @@ -111,13 +111,17 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread, #endif rtn = pthread_create( thread, &attr, start_routine, arg ); -#ifdef HAVE_PTHREAD_OS390 +#ifdef HAVE_PTHREADS_OS390 if ( rtn == -1 ) rtn = errno; #endif #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED ) if( detach ) { +#ifdef HAVE_PTHREADS_OS390 + (void) pthread_detach( thread ); +#else (void) pthread_detach( *thread ); +#endif } #endif pthread_attr_destroy(&attr); @@ -148,7 +152,7 @@ ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return ) if (thread_return==NULL) thread_return=&dummy; #endif -#ifdef HAVE_PTHREAD_OS390 +#ifdef HAVE_PTHREADS_OS390 int st = pthread_join( thread, thread_return ); if ( st == -1 ) st = errno; return st; @@ -161,7 +165,7 @@ int ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo ) { #ifdef HAVE_PTHREAD_KILL -#ifdef HAVE_PTHREAD_OS390 +#ifdef HAVE_PTHREADS_OS390 int st = pthread_kill( thread, signo ); if ( st == -1 ) st = errno; return st; @@ -187,7 +191,7 @@ ldap_pvt_thread_yield( void ) return sched_yield(); #elif HAVE_PTHREAD_YIELD -#if HAVE_PTHREAD_OS390 +#if HAVE_PTHREADS_OS390 pthread_yield(NULL); #else pthread_yield();