source: rtems/cpukit/score/src/corebarrierrelease.c @ 1506658c

5
Last change on this file since 1506658c was f97536d, checked in by Sebastian Huber <sebastian.huber@…>, on 10/16/15 at 06:21:48

basdefs.h: Add and use RTEMS_UNUSED

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief Manually releases the Barrier
5 *
6 * @ingroup ScoreBarrier
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2006.
11 *  On-Line Applications Research Corporation (OAR).
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/score/corebarrierimpl.h>
23#include <rtems/score/objectimpl.h>
24#include <rtems/score/threadqimpl.h>
25
26uint32_t _CORE_barrier_Release(
27  CORE_barrier_Control                *the_barrier,
28#if defined(RTEMS_MULTIPROCESSING)
29  Objects_Id                           id,
30  CORE_barrier_API_mp_support_callout  api_barrier_mp_support
31#else
32  Objects_Id                           id RTEMS_UNUSED,
33  CORE_barrier_API_mp_support_callout  api_barrier_mp_support RTEMS_UNUSED
34#endif
35)
36{
37  Thread_Control *the_thread;
38  uint32_t        count;
39
40  count = 0;
41  while ( (the_thread = _Thread_queue_Dequeue(&the_barrier->Wait_queue)) ) {
42#if defined(RTEMS_MULTIPROCESSING)
43    if ( !_Objects_Is_local_id( the_thread->Object.id ) )
44      (*api_barrier_mp_support) ( the_thread, id );
45#endif
46    count++;
47  }
48  the_barrier->number_of_waiting_threads = 0;
49  return count;
50}
Note: See TracBrowser for help on using the repository browser.