source:
rtems/cpukit/posix/src/semaphoredeletesupp.c
@
90f1265e
Last change on this file since 90f1265e was 90f1265e, checked in by Sebastian Huber <sebastian.huber@…>, on 04/18/16 at 04:23:27 | |
---|---|
|
|
File size: 932 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 <stdarg.h> |
22 | |
23 | #include <errno.h> |
24 | #include <fcntl.h> |
25 | #include <pthread.h> |
26 | #include <semaphore.h> |
27 | #include <limits.h> |
28 | |
29 | #include <rtems/system.h> |
30 | #include <rtems/posix/semaphoreimpl.h> |
31 | #include <rtems/seterr.h> |
32 | |
33 | void _POSIX_Semaphore_Delete( |
34 | POSIX_Semaphore_Control *the_semaphore |
35 | ) |
36 | { |
37 | if ( !the_semaphore->linked && !the_semaphore->open_count ) { |
38 | _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object ); |
39 | _CORE_semaphore_Destroy( &the_semaphore->Semaphore, NULL, 0 ); |
40 | _POSIX_Semaphore_Free( the_semaphore ); |
41 | } |
42 | } |
Note: See TracBrowser
for help on using the repository browser.