source: rtems/cpukit/posix/src/keydelete.c @ a0e6c73

4.115
Last change on this file since a0e6c73 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2007.
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.rtems.com/license/LICENSE.
8 */
9
10#if HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <errno.h>
15#include <limits.h>
16#include <pthread.h>
17#include <string.h>
18
19#include <rtems/system.h>
20#include <rtems/score/thread.h>
21#include <rtems/score/wkspace.h>
22#include <rtems/posix/key.h>
23
24/*
25 *  17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
26 */
27int pthread_key_delete(
28  pthread_key_t  key
29)
30{
31  POSIX_Keys_Control *the_key;
32  Objects_Locations   location;
33
34  the_key = _POSIX_Keys_Get( key, &location );
35  switch ( location ) {
36
37    case OBJECTS_LOCAL:
38      _Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
39
40      _POSIX_Keys_Free_memory( the_key );
41
42      /*
43       *  NOTE:  The destructor is not called and it is the responsibility
44       *         of the application to free the memory.
45       */
46      _POSIX_Keys_Free( the_key );
47      _Thread_Enable_dispatch();
48      return 0;
49
50#if defined(RTEMS_MULTIPROCESSING)
51    case OBJECTS_REMOTE:   /* should never happen */
52#endif
53    case OBJECTS_ERROR:
54      break;
55  }
56
57  return EINVAL;
58}
Note: See TracBrowser for help on using the repository browser.