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

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • 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  the_barrier = _Barrier_Get( id, &location );
32  switch ( location ) {
33
34    case OBJECTS_LOCAL:
35      _CORE_barrier_Flush(
36        &the_barrier->Barrier,
37        NULL,
38        CORE_BARRIER_WAS_DELETED
39      );
40
41      _Objects_Close( &_Barrier_Information, &the_barrier->Object );
42
43      _Barrier_Free( the_barrier );
44
45      _Objects_Put( &the_barrier->Object );
46      return RTEMS_SUCCESSFUL;
47
48#if defined(RTEMS_MULTIPROCESSING)
49    case OBJECTS_REMOTE:
50#endif
51    case OBJECTS_ERROR:
52      break;
53  }
54
55  return RTEMS_INVALID_ID;
56}
Note: See TracBrowser for help on using the repository browser.