From 917884c408708c7634e09563d7cd3ed30a4ab71a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 15 Jun 2016 10:39:09 +0200 Subject: posix: Fix poradic server initial CPU budget Update #2738. --- cpukit/posix/src/pthreadcreate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cpukit/posix/src/pthreadcreate.c') 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 */ -- cgit v1.2.3