diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-24 15:05:22 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-24 15:05:22 +0100 |
commit | b8d6eb719ad016b8e0a7752619a5004960b9711d (patch) | |
tree | 268d9f622a130b35c2d54b15b58f10a8a00ac4e1 | |
parent | rtems: Fix _Rate_monotonic_Release_postponed_job() (diff) | |
download | rtems-b8d6eb719ad016b8e0a7752619a5004960b9711d.tar.bz2 |
rtems: rtems_rate_monotonic_postponed_job_count()
Use proper locking in SMP configurations.
Update #2795.
-rw-r--r-- | cpukit/rtems/src/ratemonperiod.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c index d4746cbc6b..97547e2c77 100644 --- a/cpukit/rtems/src/ratemonperiod.c +++ b/cpukit/rtems/src/ratemonperiod.c @@ -302,22 +302,17 @@ static rtems_status_code _Rate_monotonic_Block_while_expired( return RTEMS_TIMEOUT; } -/* - * This helper function is prepared for run-time monitoring. - */ -uint32_t rtems_rate_monotonic_postponed_job_count( - rtems_id period_id -) +uint32_t rtems_rate_monotonic_postponed_job_count( rtems_id period_id ) { - Rate_monotonic_Control *the_period; - ISR_lock_Context lock_context; - Thread_Control *owner; + Rate_monotonic_Control *the_period; + ISR_lock_Context lock_context; + uint32_t jobs; the_period = _Rate_monotonic_Get( period_id, &lock_context ); _Assert( the_period != NULL ); - uint32_t jobs = the_period->postponed_jobs; - owner = the_period->owner; - _Rate_monotonic_Release( owner, &lock_context ); + + jobs = the_period->postponed_jobs; + _Rate_monotonic_Release( the_period, &lock_context ); return jobs; } |