summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadcreate.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-15 10:39:09 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-15 10:43:34 +0200
commit917884c408708c7634e09563d7cd3ed30a4ab71a (patch)
treea6a1daa00e36f2de88d99ee06066de802d807af4 /cpukit/posix/src/pthreadcreate.c
parentpsxtests/psx12: Use one file and simplify (diff)
downloadrtems-917884c408708c7634e09563d7cd3ed30a4ab71a.tar.bz2
posix: Fix poradic server initial CPU budget
Update #2738.
Diffstat (limited to 'cpukit/posix/src/pthreadcreate.c')
-rw-r--r--cpukit/posix/src/pthreadcreate.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index af19313689..a120fdda8d 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -229,6 +229,12 @@ int pthread_create(
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
+ if ( schedpolicy == SCHED_SPORADIC ) {
+ _ISR_lock_ISR_disable( &lock_context );
+ _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
+ _ISR_lock_ISR_enable( &lock_context );
+ }
+
/*
* POSIX threads are allocated and started in one operation.
*/
@@ -249,12 +255,6 @@ int pthread_create(
}
#endif
- if ( schedpolicy == SCHED_SPORADIC ) {
- _ISR_lock_ISR_disable( &lock_context );
- _POSIX_Threads_Sporadic_timer_insert( api );
- _ISR_lock_ISR_enable( &lock_context );
- }
-
/*
* Return the id and indicate we successfully created the thread
*/