4.115
Last change
on this file since 2d7ae960 was
a19ae9ec,
checked in by Sebastian Huber <sebastian.huber@…>, on 08/23/10 at 16:10:53
|
2010-08-23 Sebastian Huber <sebastian.huber@…>
PR 1673/cpukit
- score/src/chainappendempty.c, score/src/chaingetempty.c,
score/src/chainprependempty.c: New files.
- score/Makefile.am: Reflect changes above.
- score/include/rtems/score/chain.h: Declare
_Chain_Append_with_empty_check(), _Chain_Prepend_with_empty_check(),
and _Chain_Get_with_empty_check().
- score/inline/rtems/score/chain.inl: Define
_Chain_Append_with_empty_check_unprotected(),
_Chain_Prepend_with_empty_check_unprotected(), and
_Chain_Get_with_empty_check_unprotected().
|
-
Property mode set to
100644
|
File size:
853 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ScoreChain |
---|
5 | * |
---|
6 | * @brief _Chain_Get_with_empty_check() implementation. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2010 embedded brains GmbH. All rights reserved. |
---|
11 | * |
---|
12 | * embedded brains GmbH |
---|
13 | * Obere Lagerstr. 30 |
---|
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.com/license/LICENSE. |
---|
21 | */ |
---|
22 | |
---|
23 | #if HAVE_CONFIG_H |
---|
24 | #include "config.h" |
---|
25 | #endif |
---|
26 | |
---|
27 | #include <rtems/system.h> |
---|
28 | #include <rtems/score/chain.h> |
---|
29 | #include <rtems/score/isr.h> |
---|
30 | |
---|
31 | bool _Chain_Get_with_empty_check( |
---|
32 | Chain_Control *chain, |
---|
33 | Chain_Node **node |
---|
34 | ) |
---|
35 | { |
---|
36 | ISR_Level level; |
---|
37 | bool is_empty_now; |
---|
38 | |
---|
39 | _ISR_Disable( level ); |
---|
40 | is_empty_now = _Chain_Get_with_empty_check_unprotected( chain, node ); |
---|
41 | _ISR_Enable( level ); |
---|
42 | |
---|
43 | return is_empty_now; |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.