OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [semaphoredeletesupp.c] - Blame information for rev 773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: semaphoredeletesupp.c,v 1.2 2001-09-27 11:59:17 chris Exp $
3
 */
4
 
5
#include <stdarg.h>
6
 
7
#include <errno.h>
8
#include <fcntl.h>
9
#include <pthread.h>
10
#include <semaphore.h>
11
#include <limits.h>
12
 
13
#include <rtems/system.h>
14
#include <rtems/score/object.h>
15
#include <rtems/posix/semaphore.h>
16
#include <rtems/posix/time.h>
17
#include <rtems/posix/seterr.h>
18
 
19
/*PAGE
20
 *
21
 *  _POSIX_Semaphore_Delete
22
 */
23
 
24
void _POSIX_Semaphore_Delete(
25
  POSIX_Semaphore_Control *the_semaphore
26
)
27
{
28
  if ( !the_semaphore->linked && !the_semaphore->open_count ) {
29
      _Objects_Close( &_POSIX_Semaphore_Information, &the_semaphore->Object );
30
 
31
      _CORE_semaphore_Flush(
32
        &the_semaphore->Semaphore,
33
#if defined(RTEMS_MULTIPROCESSING)
34
        _POSIX_Semaphore_MP_Send_object_was_deleted,
35
#else
36
        NULL,
37
#endif
38
        -1  /* XXX should also seterrno -> EINVAL */
39
      );
40
 
41
    _POSIX_Semaphore_Free( the_semaphore );
42
 
43
#if defined(RTEMS_MULTIPROCESSING)
44
    if ( the_semaphore->process_shared == PTHREAD_PROCESS_SHARED ) {
45
 
46
      _Objects_MP_Close(
47
        &_POSIX_Semaphore_Information,
48
        the_semaphore->Object.id
49
      );
50
 
51
      _POSIX_Semaphore_MP_Send_process_packet(
52
        POSIX_SEMAPHORE_MP_ANNOUNCE_DELETE,
53
        the_semaphore->Object.id,
54
        0,                         /* Not used */
55
 
56
      );
57
    }
58
#endif
59
 
60
  }
61
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.