diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-08-04 10:20:29 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-08-04 10:20:29 +0200 |
commit | ee0e41355d1faa5f74085effc4f57c3a7fc1f884 (patch) | |
tree | c845395523e084218ca6715977648b807d30605d /cpukit/rtems/src/ratemoncreate.c | |
parent | score: Fix _Thread_queue_Path_release() (diff) | |
download | rtems-ee0e41355d1faa5f74085effc4f57c3a7fc1f884.tar.bz2 |
score: Fix a release/cancel job race condition
Split up the potential thread priority change in the scheduler
release/cancel job operation. Protect the rate monotonic period state
with a dedicated SMP lock. This avoids a race condition during
_Rate_monotonic_Timeout() while _Rate_monotonic_Cancel() is called on
another processor.
Diffstat (limited to 'cpukit/rtems/src/ratemoncreate.c')
-rw-r--r-- | cpukit/rtems/src/ratemoncreate.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cpukit/rtems/src/ratemoncreate.c b/cpukit/rtems/src/ratemoncreate.c index 1a5c9b2615..a86c6a1eeb 100644 --- a/cpukit/rtems/src/ratemoncreate.c +++ b/cpukit/rtems/src/ratemoncreate.c @@ -62,6 +62,8 @@ rtems_status_code rtems_rate_monotonic_create( return RTEMS_TOO_MANY; } + _ISR_lock_Initialize( &the_period->Lock, "Rate Monotonic Period" ); + the_period->owner = _Thread_Get_executing(); the_period->state = RATE_MONOTONIC_INACTIVE; |