From 54550e048d3a49435912797d2024f80671e93267 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 13 May 2016 08:16:30 +0200 Subject: posix: Rework pthread_join() Rework pthread_join() to use _Thread_Join(). Close #2402. Update #2555. Update #2626. Close #2714. --- cpukit/posix/src/pthreadcreate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpukit/posix/src/pthreadcreate.c') diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index eedb80e203..1fe3fe4465 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -201,6 +201,10 @@ int pthread_create( return EAGAIN; } + if ( the_attr->detachstate == PTHREAD_CREATE_DETACHED ) { + the_thread->Life.state |= THREAD_LIFE_DETACHED; + } + #if defined(RTEMS_SMP) && __RTEMS_HAVE_SYS_CPUSET_H__ _ISR_lock_ISR_disable( &lock_context ); status = _Scheduler_Set_affinity( @@ -222,7 +226,6 @@ int pthread_create( api = the_thread->API_Extensions[ THREAD_API_POSIX ]; _POSIX_Threads_Copy_attributes( &api->Attributes, the_attr ); - api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; -- cgit v1.2.3