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/include/rtems/rtems/ratemonimpl.h | |
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/include/rtems/rtems/ratemonimpl.h')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/ratemonimpl.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/ratemonimpl.h b/cpukit/rtems/include/rtems/rtems/ratemonimpl.h index 9963cab612..b6b3ffd404 100644 --- a/cpukit/rtems/include/rtems/rtems/ratemonimpl.h +++ b/cpukit/rtems/include/rtems/rtems/ratemonimpl.h @@ -69,19 +69,19 @@ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void ) } RTEMS_INLINE_ROUTINE void _Rate_monotonic_Acquire_critical( - Thread_Control *the_thread, - ISR_lock_Context *lock_context + Rate_monotonic_Control *the_period, + ISR_lock_Context *lock_context ) { - _Thread_Wait_acquire_default_critical( the_thread, lock_context ); + _ISR_lock_Acquire( &the_period->Lock, lock_context ); } RTEMS_INLINE_ROUTINE void _Rate_monotonic_Release( - Thread_Control *the_thread, - ISR_lock_Context *lock_context + Rate_monotonic_Control *the_period, + ISR_lock_Context *lock_context ) { - _Thread_Wait_release_default( the_thread, lock_context ); + _ISR_lock_Release_and_ISR_enable( &the_period->Lock, lock_context ); } RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get( |