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

Last change on this file since e781ddb was e781ddb, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 17, 2016 at 1:57:03 PM

score: Simplify _CORE_barrier_Flush()

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Delete Barrier
5 *  @ingroup ClassicBarrier
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
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
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/barrierimpl.h>
22#include <rtems/score/threadqimpl.h>
23
24rtems_status_code rtems_barrier_delete(
25  rtems_id   id
26)
27{
28  Barrier_Control   *the_barrier;
29  Objects_Locations  location;
30
31  _Objects_Allocator_lock();
32  the_barrier = _Barrier_Get( id, &location );
33  switch ( location ) {
34
35    case OBJECTS_LOCAL:
36      _CORE_barrier_Flush( &the_barrier->Barrier, NULL, 0 );
37      _Objects_Close( &_Barrier_Information, &the_barrier->Object );
38      _Objects_Put( &the_barrier->Object );
39      _Barrier_Free( the_barrier );
40      _Objects_Allocator_unlock();
41      return RTEMS_SUCCESSFUL;
42
43#if defined(RTEMS_MULTIPROCESSING)
44    case OBJECTS_REMOTE:
45#endif
46    case OBJECTS_ERROR:
47      break;
48  }
49
50  _Objects_Allocator_unlock();
51
52  return RTEMS_INVALID_ID;
53}
Note: See TracBrowser for help on using the repository browser.