source: rtems/cpukit/sapi/src/chaingetwait.c @ 80cf60e

5
Last change on this file since 80cf60e was 80cf60e, checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/20 at 07:48:32

Canonicalize config.h include

Use the following variant which was already used by most source files:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicChains
5 *
6 * @brief rtems_chain_get_with_wait() 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.org/license/LICENSE.
21 */
22
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#include <rtems/chain.h>
28
29rtems_status_code rtems_chain_get_with_wait(
30  rtems_chain_control *chain,
31  rtems_event_set events,
32  rtems_interval timeout,
33  rtems_chain_node **node_ptr
34)
35{
36  rtems_status_code sc = RTEMS_SUCCESSFUL;
37  rtems_chain_node *node = NULL;
38
39  while (
40    sc == RTEMS_SUCCESSFUL
41      && (node = rtems_chain_get( chain )) == NULL
42  ) {
43    rtems_event_set out;
44    sc = rtems_event_receive(
45      events,
46      RTEMS_EVENT_ALL | RTEMS_WAIT,
47      timeout,
48      &out
49    );
50  }
51
52  *node_ptr = node;
53
54  return sc;
55}
Note: See TracBrowser for help on using the repository browser.