source: rtems/cpukit/score/src/corebarrierwait.c @ 9b4422a2

4.11
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.1 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
16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <rtems/system.h>
21#include <rtems/score/isr.h>
22#include <rtems/score/corebarrier.h>
23#include <rtems/score/states.h>
24#include <rtems/score/thread.h>
25#include <rtems/score/threadq.h>
26
27/*
28 *  _CORE_barrier_Wait
29 *
30 *  Input parameters:
31 *    the_barrier - pointer to barrier control block
32 *    id          - id of object to wait on
33 *    wait        - true if wait is allowed, false otherwise
34 *    timeout     - number of ticks to wait (0 means forever)
35 *    api_barrier_mp_support - api dependent MP support actions
36 *
37 *  Output parameters:  NONE
38 *
39 *  INTERRUPT LATENCY:
40 *    available
41 *    wait
42 */
43
44void _CORE_barrier_Wait(
45  CORE_barrier_Control                *the_barrier,
46  Objects_Id                           id,
47  bool                                 wait,
48  Watchdog_Interval                    timeout,
49  CORE_barrier_API_mp_support_callout  api_barrier_mp_support
50)
51{
52  Thread_Control *executing;
53  ISR_Level       level;
54
55  executing = _Thread_Executing;
56  executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL;
57  _ISR_Disable( level );
58  the_barrier->number_of_waiting_threads++;
59  if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) {
60    if ( the_barrier->number_of_waiting_threads ==
61         the_barrier->Attributes.maximum_count) {
62      executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED;
63      _ISR_Enable( level );
64      _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support );
65      return;
66    }
67  }
68
69  _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue );
70  executing->Wait.queue          = &the_barrier->Wait_queue;
71  executing->Wait.id             = id;
72  _ISR_Enable( level );
73
74  _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
75}
Note: See TracBrowser for help on using the repository browser.