source: rtems/cpukit/rtems/src/ratemondelete.c @ 66cb142

5
Last change on this file since 66cb142 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: 1.1 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Delete Rate Monotonic
5 *  @ingroup ClassicRateMon
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
10 *  On-Line Applications Research Corporation (OAR).
11 *  Copyright (c) 2016 embedded brains GmbH.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/rtems/ratemonimpl.h>
23
24rtems_status_code rtems_rate_monotonic_delete(
25  rtems_id id
26)
27{
28  Rate_monotonic_Control *the_period;
29  ISR_lock_Context        lock_context;
30  rtems_status_code       status;
31
32  _Objects_Allocator_lock();
33
34  the_period = _Rate_monotonic_Get( id, &lock_context );
35  if ( the_period != NULL ) {
36    _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
37    _Rate_monotonic_Cancel( the_period, the_period->owner, &lock_context );
38    _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
39    status = RTEMS_SUCCESSFUL;
40  } else {
41    status = RTEMS_INVALID_ID;
42  }
43
44  _Objects_Allocator_unlock();
45
46  return status;
47}
Note: See TracBrowser for help on using the repository browser.