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

4.115
Last change on this file since c86da31c was f0b14cf2, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/31/08 at 03:24:18

Add attribute((unused)) to unused function args.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  SuperCore Barrier Handler
3 *
4 *  DESCRIPTION:
5 *
6 *  This package is part of the implementation of the SuperCore Barrier Handler.
7 *
8 *  COPYRIGHT (c) 1989-2006.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/system.h>
23#include <rtems/score/isr.h>
24#include <rtems/score/corebarrier.h>
25#include <rtems/score/states.h>
26#include <rtems/score/thread.h>
27#include <rtems/score/threadq.h>
28
29/*PAGE
30 *
31 *  _CORE_barrier_Release
32 *
33 *  Input parameters:
34 *    the_barrier            - the barrier to be flushed
35 *    id                     - id of the object for a remote unblock
36 *    api_barrier_mp_support - api dependent MP support actions
37 *
38 *  Output parameters:
39 *    CORE_BARRIER_STATUS_SUCCESSFUL - if successful
40 *    core error code                - if unsuccessful
41 *
42 *  Output parameters:
43 *    returns number of threads unblocked
44 */
45
46uint32_t _CORE_barrier_Release(
47  CORE_barrier_Control                *the_barrier,
48#if defined(RTEMS_MULTIPROCESSING)
49  Objects_Id                           id,
50  CORE_barrier_API_mp_support_callout  api_barrier_mp_support
51#else
52  Objects_Id                           id __attribute__((unused)),
53  CORE_barrier_API_mp_support_callout  api_barrier_mp_support __attribute__((unused))
54#endif
55)
56{
57  Thread_Control *the_thread;
58  uint32_t        count;
59
60  count = 0;
61  while ( (the_thread = _Thread_queue_Dequeue(&the_barrier->Wait_queue)) ) {
62#if defined(RTEMS_MULTIPROCESSING)
63    if ( !_Objects_Is_local_id( the_thread->Object.id ) )
64      (*api_barrier_mp_support) ( the_thread, id );
65#endif
66    count++;
67  }
68  the_barrier->number_of_waiting_threads = 0;
69  return count;
70}
Note: See TracBrowser for help on using the repository browser.