source: rtems/cpukit/posix/src/conddestroy.c @ 976162a6

4.104.114.9
Last change on this file since 976162a6 was 976162a6, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 3, 2007 at 10:23:13 PM

2007-12-03 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/malloc.c, libmisc/monitor/mon-command.c, posix/preinstall.am, posix/include/rtems/posix/cond.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/semaphore.h, posix/src/conddestroy.c, posix/src/mutexdestroy.c, posix/src/mutexinit.c, posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c, sapi/include/confdefs.h, sapi/include/rtems/config.h, sapi/include/rtems/init.h, sapi/include/rtems/sptables.h, sapi/src/exinit.c, score/include/rtems/system.h, score/include/rtems/score/mpci.h, score/src/mpci.c, score/src/thread.c, score/src/threadcreateidle.c, score/src/threadstackallocate.c, score/src/threadstackfree.c, score/src/wkspace.c: Moved most of the remaining CPU Table fields to the Configuration Table. This included pretasking_hook, predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace, extra_mpci_receive_server_stack, stack_allocate_hook, and stack_free_hook. As a side-effect of this effort some multiprocessing code was made conditional and some style clean up occurred.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  $Id$
3 */
4
5#if HAVE_CONFIG_H
6#include "config.h"
7#endif
8
9#include <pthread.h>
10#include <errno.h>
11
12#include <rtems/system.h>
13#include <rtems/score/object.h>
14#include <rtems/score/states.h>
15#include <rtems/score/watchdog.h>
16#include <rtems/posix/cond.h>
17#include <rtems/posix/time.h>
18#include <rtems/posix/mutex.h>
19
20/*PAGE
21 *
22 *  11.4.2 Initializing and Destroying a Condition Variable,
23 *         P1003.1c/Draft 10, p. 87
24 */
25
26int pthread_cond_destroy(
27  pthread_cond_t           *cond
28)
29{
30  POSIX_Condition_variables_Control *the_cond;
31  Objects_Locations                  location;
32
33  the_cond = _POSIX_Condition_variables_Get( cond, &location );
34  switch ( location ) {
35
36    case OBJECTS_LOCAL:
37
38      if ( _Thread_queue_First( &the_cond->Wait_queue ) ) {
39        _Thread_Enable_dispatch();
40        return EBUSY;
41      }
42
43      _Objects_Close(
44        &_POSIX_Condition_variables_Information,
45        &the_cond->Object
46      );
47
48      _POSIX_Condition_variables_Free( the_cond );
49      _Thread_Enable_dispatch();
50      return 0;
51
52#if defined(RTEMS_MULTIPROCESSING)
53    case OBJECTS_REMOTE:
54#endif
55    case OBJECTS_ERROR:
56      break;
57  }
58
59  return EINVAL;
60}
Note: See TracBrowser for help on using the repository browser.