source: rtems/cpukit/itron/src/del_mbx.c @ 4bf1801

4.104.114.84.95
Last change on this file since 4bf1801 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 *  ITRON 3.0 Mailbox Manager
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.OARcorp.com/rtems/license.html.
10 *
11 *  $Id$
12 */
13
14#include <itron.h>
15
16#include <rtems/itron/mbox.h>
17#include <rtems/itron/task.h>
18
19/*
20 *  del_mbx - Delete Mailbox
21 *
22 *
23 * ------Parameters--------------
24 * ID mbxid      The Mailbox's ID
25 * ------------------------------
26 *
27 * -----Return Parameters-------
28 * ER ercd       Itron Error Code
29 * -----------------------------
30 *
31 * -----C Language Interface----
32 * ER ercd = del_mbx(ID mbxid);
33 * -----------------------------
34 *
35 */
36
37ER del_mbx(
38  ID mbxid
39)
40{
41  register ITRON_Mailbox_Control *the_mailbox;
42  Objects_Locations               location;
43
44  the_mailbox= _ITRON_Mailbox_Get( mbxid, &location );
45  switch ( location ) {
46    case OBJECTS_ERROR:
47    case OBJECTS_REMOTE:
48      return _ITRON_Mailbox_Clarify_get_id_error( mbxid );
49
50    case OBJECTS_LOCAL:
51      _Objects_Close( &_ITRON_Mailbox_Information, &the_mailbox->Object );
52
53      _CORE_message_queue_Close(
54        &the_mailbox->message_queue,
55        NULL,                      /* Multiprocessing not supported */
56        CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED
57      );
58
59      _ITRON_Mailbox_Free(the_mailbox);
60      break;
61  }
62
63  _ITRON_return_errorno( E_OK );
64}
Note: See TracBrowser for help on using the repository browser.