summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadcreate.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-13 14:07:23 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:39 +0200
commit33829ce155069462ba410d396da431386369ed08 (patch)
treebd4d700e4a567280c6b2aa3e8f43c3997d20d9e7 /cpukit/posix/src/pthreadcreate.c
parentposix: Rework pthread_join() (diff)
downloadrtems-33829ce155069462ba410d396da431386369ed08.tar.bz2
score: Avoid Giant lock for _Thread_Start()
Update #2555.
Diffstat (limited to 'cpukit/posix/src/pthreadcreate.c')
-rw-r--r--cpukit/posix/src/pthreadcreate.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index 1fe3fe4465..33fae37776 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -229,12 +229,11 @@ int pthread_create(
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
- _Thread_Disable_dispatch();
-
/*
* POSIX threads are allocated and started in one operation.
*/
- status = _Thread_Start( the_thread, &entry );
+ _ISR_lock_ISR_disable( &lock_context );
+ status = _Thread_Start( the_thread, &entry, &lock_context );
#if defined(RTEMS_DEBUG)
/*
@@ -244,7 +243,6 @@ int pthread_create(
* thread while we are creating it.
*/
if ( !status ) {
- _Thread_Enable_dispatch();
_POSIX_Threads_Free( the_thread );
_Objects_Allocator_unlock();
return EINVAL;
@@ -261,8 +259,6 @@ int pthread_create(
_ISR_lock_ISR_enable( &lock_context );
}
- _Thread_Enable_dispatch();
-
/*
* Return the id and indicate we successfully created the thread
*/