source: rtems/cpukit/posix/src/semaphoredeletesupp.c @ 2581a56

5
Last change on this file since 2581a56 was 2581a56, checked in by Sebastian Huber <sebastian.huber@…>, on 05/20/16 at 19:39:56

score: Add semaphore variants

  • Property mode set to 100644
File size: 941 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief POSIX Delete Semaphore
5 *  @ingroup POSIX_SEMAPHORE
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/posix/semaphoreimpl.h>
22
23void _POSIX_Semaphore_Delete(
24  POSIX_Semaphore_Control *the_semaphore,
25  Thread_queue_Context    *queue_context
26)
27{
28  if ( !the_semaphore->linked && !the_semaphore->open_count ) {
29    _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object );
30    _CORE_semaphore_Destroy(
31      &the_semaphore->Semaphore,
32      POSIX_SEMAPHORE_TQ_OPERATIONS,
33      queue_context
34    );
35    _POSIX_Semaphore_Free( the_semaphore );
36  } else {
37    _CORE_semaphore_Release( &the_semaphore->Semaphore, queue_context );
38  }
39}
Note: See TracBrowser for help on using the repository browser.