blob: 541287569a24ea40e8609e24cae31198b0ca72fd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/**
* @file
*
* @ingroup RTEMSImplClassicRateMonotonic
*
* @brief This source file contains the implementation of
* rtems_rate_monotonic_delete().
*/
/*
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
* Copyright (c) 2016 embedded brains GmbH.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems/rtems/ratemonimpl.h>
rtems_status_code rtems_rate_monotonic_delete(
rtems_id id
)
{
Rate_monotonic_Control *the_period;
ISR_lock_Context lock_context;
rtems_status_code status;
_Objects_Allocator_lock();
the_period = _Rate_monotonic_Get( id, &lock_context );
if ( the_period != NULL ) {
_Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
_Rate_monotonic_Cancel( the_period, the_period->owner, &lock_context );
_Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
status = RTEMS_SUCCESSFUL;
} else {
status = RTEMS_INVALID_ID;
}
_Objects_Allocator_unlock();
return status;
}
|