summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/ratemontimeout.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-04 10:20:29 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-04 10:20:29 +0200
commitee0e41355d1faa5f74085effc4f57c3a7fc1f884 (patch)
treec845395523e084218ca6715977648b807d30605d /cpukit/rtems/src/ratemontimeout.c
parentscore: Fix _Thread_queue_Path_release() (diff)
downloadrtems-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/ratemontimeout.c')
-rw-r--r--cpukit/rtems/src/ratemontimeout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/rtems/src/ratemontimeout.c b/cpukit/rtems/src/ratemontimeout.c
index bd38153b82..e514a314b3 100644
--- a/cpukit/rtems/src/ratemontimeout.c
+++ b/cpukit/rtems/src/ratemontimeout.c
@@ -31,7 +31,7 @@ void _Rate_monotonic_Timeout( Watchdog_Control *the_watchdog )
owner = the_period->owner;
_ISR_lock_ISR_disable( &lock_context );
- _Rate_monotonic_Acquire_critical( owner, &lock_context );
+ _Rate_monotonic_Acquire_critical( the_period, &lock_context );
wait_flags = _Thread_Wait_flags_get( owner );
if (
@@ -63,6 +63,6 @@ void _Rate_monotonic_Timeout( Watchdog_Control *the_watchdog )
}
} else {
the_period->state = RATE_MONOTONIC_EXPIRED;
- _Rate_monotonic_Release( owner, &lock_context );
+ _Rate_monotonic_Release( the_period, &lock_context );
}
}