RTEMS
barrierdelete.c
Go to the documentation of this file.
1 
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 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
22 
24  rtems_id id
25 )
26 {
27  Barrier_Control *the_barrier;
28  Thread_queue_Context queue_context;
29 
31  the_barrier = _Barrier_Get( id, &queue_context );
32 
33  if ( the_barrier == NULL ) {
35  return RTEMS_INVALID_ID;
36  }
37 
38  _CORE_barrier_Acquire_critical( &the_barrier->Barrier, &queue_context );
39  _Objects_Close( &_Barrier_Information, &the_barrier->Object );
40  _CORE_barrier_Flush( &the_barrier->Barrier, &queue_context );
41  _Barrier_Free( the_barrier );
43  return RTEMS_SUCCESSFUL;
44 }
static __inline__ void _Objects_Allocator_unlock(void)
Unlocks the object allocator mutex.
Definition: objectimpl.h:846
Objects_Control Object
Definition: barrierdata.h:40
rtems_status_code rtems_barrier_delete(rtems_id id)
%
Definition: barrierdelete.c:23
Thread queue context for the thread queue methods.
Definition: threadq.h:198
Objects_Information _Barrier_Information
The Classic Barrier objects information.
Definition: barrier.c:47
static __inline__ void _Objects_Allocator_lock(void)
Locks the object allocator mutex.
Definition: objectimpl.h:834
static __inline__ void _Barrier_Free(Barrier_Control *the_barrier)
_Barrier_Free
Definition: barrierimpl.h:54
This status code indicates successful completion.
Definition: status.h:86
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
static __inline__ void _CORE_barrier_Acquire_critical(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Acquires critical core barrier.
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
CORE_barrier_Control Barrier
Definition: barrierdata.h:42
static __inline__ void _CORE_barrier_Flush(CORE_barrier_Control *the_barrier, Thread_queue_Context *queue_context)
Flushes the barrier using _CORE_barrier_Do_flush().
void _Objects_Close(const Objects_Information *information, Objects_Control *the_object)
Closes object.
Definition: objectclose.c:23
Classic Barrier Manager Implementation.