summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 64270e94d9..b780eccfe9 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -196,6 +196,8 @@ int pthread_create(
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
+ _Thread_Disable_dispatch();
+
/*
* POSIX threads are allocated and started in one operation.
*/
@@ -216,6 +218,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;
@@ -229,6 +232,8 @@ int pthread_create(
);
}
+ _Thread_Enable_dispatch();
+
/*
* Return the id and indicate we successfully created the thread
*/