summaryrefslogtreecommitdiffstats
path: root/cpukit/posix
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix')
-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
*/