summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadcreate.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/pthreadcreate.c')
-rw-r--r--cpukit/posix/src/pthreadcreate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index c5ca86d52e..054261b5ef 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -198,6 +198,8 @@ int pthread_create(
*/
the_thread->do_post_task_switch_extension = true;
+ _Thread_Disable_dispatch();
+
/*
* POSIX threads are allocated and started in one operation.
*/
@@ -217,6 +219,7 @@ int pthread_create(
* thread while we are creating it.
*/
if ( !status ) {
+ _Thread_Enable_dispatch();
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
return EINVAL;
@@ -230,6 +233,8 @@ int pthread_create(
);
}
+ _Thread_Enable_dispatch();
+
/*
* Return the id and indicate we successfully created the thread
*/