5
Last change
on this file since 90960bd was
90960bd,
checked in by Sebastian Huber <sebastian.huber@…>, on 03/21/16 at 14:01:57
|
rtems: Rework rate-monotonic scheduler
Use the default thread lock to protect rate-monotonic state changes.
This avoids use of the Giant lock. Split rtems_rate_monotonic_period()
body into several static functions. Introduce a new thread wait class
THREAD_WAIT_CLASS_PERIOD for period objects to synchronize the blocking
operation.
Close #2631.
|
-
Property mode set to
100644
|
File size:
984 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief RTEMS Rate Monotonic Reset Statistics |
---|
5 | * @ingroup ClassicRateMon Rate Monotonic Scheduler |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2007. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/rtems/ratemonimpl.h> |
---|
22 | |
---|
23 | rtems_status_code rtems_rate_monotonic_reset_statistics( |
---|
24 | rtems_id id |
---|
25 | ) |
---|
26 | { |
---|
27 | Rate_monotonic_Control *the_period; |
---|
28 | ISR_lock_Context lock_context; |
---|
29 | Thread_Control *owner; |
---|
30 | |
---|
31 | the_period = _Rate_monotonic_Get( id, &lock_context ); |
---|
32 | if ( the_period == NULL ) { |
---|
33 | return RTEMS_INVALID_ID; |
---|
34 | } |
---|
35 | |
---|
36 | owner = the_period->owner; |
---|
37 | _Rate_monotonic_Acquire_critical( owner, &lock_context ); |
---|
38 | _Rate_monotonic_Reset_statistics( the_period ); |
---|
39 | _Rate_monotonic_Release( owner, &lock_context ); |
---|
40 | return RTEMS_SUCCESSFUL; |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.