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

4.115
Last change on this file since eea7c937 was a2e3f33, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 11:50:54

score: Create object implementation header

Move implementation specific parts of object.h and object.inl into new
header file objectimpl.h. The object.h contains now only the
application visible API.

  • 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.com/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 __attribute__((unused)),
33  CORE_barrier_API_mp_support_callout  api_barrier_mp_support __attribute__((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.