source: rtems/c/src/exec/itron/src/del_sem.c @ 9d9a3dd

4.104.114.84.95
Last change on this file since 9d9a3dd was 9d9a3dd, checked in by Jennifer Averett <Jennifer.Averett@…>, on 11/17/99 at 16:47:58

+ Updated copyright information.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-1999.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.OARcorp.com/rtems/license.html.
8 *
9 *  $Id$
10 */
11
12#include <itron.h>
13
14#include <rtems/itron/semaphore.h>
15#include <rtems/itron/task.h>
16#include <rtems/score/tod.h>
17
18/*
19 *  del_sem - Delete Semaphore
20 *
21 *  This function implements the ITRON 3.0 del_sem() service.
22 */
23
24ER del_sem(
25  ID semid
26)
27{
28  ITRON_Semaphore_Control *the_semaphore;
29  Objects_Locations        location;
30 
31  the_semaphore = _ITRON_Semaphore_Get( semid, &location );
32  switch ( location ) {
33    case OBJECTS_REMOTE:               /* Multiprocessing not supported */
34    case OBJECTS_ERROR:
35      return _ITRON_Semaphore_Clarify_get_id_error( semid );
36 
37    case OBJECTS_LOCAL:
38      _CORE_semaphore_Flush(
39        &the_semaphore->semaphore,
40        NULL,                          /* Multiprocessing not supported */
41        CORE_SEMAPHORE_WAS_DELETED
42      );
43
44      _ITRON_Objects_Close(
45        &_ITRON_Semaphore_Information,
46        &the_semaphore->Object
47      );
48
49      _ITRON_Semaphore_Free( the_semaphore );
50
51  /*
52   *  If multiprocessing were supported, this is where we would announce
53   *  the destruction of the semaphore to the rest of the system.
54   */
55
56#if defined(RTEMS_MULTIPROCESSING)
57#endif
58
59    _Thread_Enable_dispatch();
60    return E_OK;
61
62  }
63  return E_OK;
64}
Note: See TracBrowser for help on using the repository browser.