summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadcreate.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-11 10:58:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 13:24:41 +0200
commite135271b933c896068a343b161773ce3b685be43 (patch)
tree83faf308498a9695ba551f8e5b3f7473daa37d68 /cpukit/posix/src/pthreadcreate.c
parentscore: Use thread state lock for current state (diff)
downloadrtems-e135271b933c896068a343b161773ce3b685be43.tar.bz2
score: Avoid Giant lock _Scheduler_Set_affinity()
Update #2555.
Diffstat (limited to '')
-rw-r--r--cpukit/posix/src/pthreadcreate.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index 2533345ff6..eedb80e203 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -74,7 +74,7 @@ int pthread_create(
struct sched_param schedparam;
Objects_Name name;
int rc;
- ISR_Level level;
+ ISR_lock_Context lock_context;
if ( !start_routine )
return EFAULT;
@@ -202,11 +202,13 @@ int pthread_create(
}
#if defined(RTEMS_SMP) && __RTEMS_HAVE_SYS_CPUSET_H__
+ _ISR_lock_ISR_disable( &lock_context );
status = _Scheduler_Set_affinity(
the_thread,
the_attr->affinitysetsize,
the_attr->affinityset
);
+ _ISR_lock_ISR_enable( &lock_context );
if ( !status ) {
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
@@ -247,13 +249,13 @@ int pthread_create(
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
- _ISR_Disable_without_giant( level );
+ _ISR_lock_ISR_disable( &lock_context );
_Watchdog_Per_CPU_insert_relative(
&api->Sporadic_timer,
_Per_CPU_Get(),
_Timespec_To_ticks( &api->schedparam.sched_ss_repl_period )
);
- _ISR_Enable_without_giant( level );
+ _ISR_lock_ISR_enable( &lock_context );
}
_Thread_Enable_dispatch();