RTEMS
watchdogremove.c
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2016 embedded brains GmbH. All rights reserved.
11  *
12  * embedded brains GmbH
13  * Dornierstr. 4
14  * 82178 Puchheim
15  * Germany
16  * <rtems@embedded-brains.de>
17  *
18  * The license and distribution terms for this file may be
19  * found in the file LICENSE in this distribution or at
20  * http://www.rtems.org/license/LICENSE.
21  */
22 
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26 
28 
30  Watchdog_Header *header,
31  Watchdog_Control *the_watchdog
32 )
33 {
34  if ( _Watchdog_Is_scheduled( the_watchdog ) ) {
35  if ( header->first == &the_watchdog->Node.RBTree ) {
36  _Watchdog_Next_first( header, the_watchdog );
37  }
38 
39  _RBTree_Extract( &header->Watchdogs, &the_watchdog->Node.RBTree );
40  _Watchdog_Set_state( the_watchdog, WATCHDOG_INACTIVE );
41  }
42 }
union Watchdog_Control::@33 Node
Nodes for the watchdog.
RBTree_Node * first
The scheduled watchdog with the earliest expiration time or NULL in case no watchdog is scheduled...
Definition: watchdog.h:81
The watchdog is inactive.
Definition: watchdogimpl.h:61
static __inline__ void _Watchdog_Next_first(Watchdog_Header *header, Watchdog_Control *the_watchdog)
Sets the first node of the header.
Definition: watchdogimpl.h:366
Inlined Routines in the Watchdog Handler.
The control block used to manage each watchdog timer.
Definition: watchdog.h:90
void _Watchdog_Remove(Watchdog_Header *header, Watchdog_Control *the_watchdog)
In the case the watchdog is scheduled, then it is removed from the set of scheduled watchdogs...
RBTree_Control Watchdogs
Red-black tree of scheduled watchdogs sorted by expiration time.
Definition: watchdog.h:75
static __inline__ bool _Watchdog_Is_scheduled(const Watchdog_Control *the_watchdog)
Checks if the watchdog is scheduled.
Definition: watchdogimpl.h:348
RBTree_Node RBTree
this field is a red-black tree node structure and allows this to be placed on a red-black tree used t...
Definition: watchdog.h:99
The watchdog header to manage scheduled watchdogs.
Definition: watchdog.h:71
void _RBTree_Extract(RBTree_Control *the_rbtree, RBTree_Node *the_node)
Extracts (removes) the node from the red-black tree.
Definition: rbtreeextract.c:35
static __inline__ void _Watchdog_Set_state(Watchdog_Control *the_watchdog, Watchdog_State state)
Sets the state of the watchdog.
Definition: watchdogimpl.h:162