source: rtems/cpukit/rtems/src/barrierdelete.c @ e781ddb

5
Last change on this file since e781ddb was e781ddb, checked in by Sebastian Huber <sebastian.huber@…>, on 04/17/16 at 13:57:03

score: Simplify _CORE_barrier_Flush()

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[60ceb613]1/**
2 *  @file
[8042961d]3 *
[60ceb613]4 *  @brief RTEMS Delete Barrier
5 *  @ingroup ClassicBarrier
6 */
7
8/*
[0e87deaa]9 *  COPYRIGHT (c) 1989-2007.
[8042961d]10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
[c499856]14 *  http://www.rtems.org/license/LICENSE.
[8042961d]15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
[0b32bb8]21#include <rtems/rtems/barrierimpl.h>
[a112364]22#include <rtems/score/threadqimpl.h>
[8042961d]23
24rtems_status_code rtems_barrier_delete(
25  rtems_id   id
26)
27{
28  Barrier_Control   *the_barrier;
29  Objects_Locations  location;
30
[23fec9f0]31  _Objects_Allocator_lock();
[8042961d]32  the_barrier = _Barrier_Get( id, &location );
33  switch ( location ) {
34
35    case OBJECTS_LOCAL:
[e781ddb]36      _CORE_barrier_Flush( &the_barrier->Barrier, NULL, 0 );
[8042961d]37      _Objects_Close( &_Barrier_Information, &the_barrier->Object );
[2d2352b]38      _Objects_Put( &the_barrier->Object );
[23fec9f0]39      _Barrier_Free( the_barrier );
40      _Objects_Allocator_unlock();
[8042961d]41      return RTEMS_SUCCESSFUL;
[ebe61382]42
43#if defined(RTEMS_MULTIPROCESSING)
44    case OBJECTS_REMOTE:
45#endif
46    case OBJECTS_ERROR:
47      break;
[8042961d]48  }
49
[23fec9f0]50  _Objects_Allocator_unlock();
51
[ebe61382]52  return RTEMS_INVALID_ID;
[8042961d]53}
Note: See TracBrowser for help on using the repository browser.