source: rtems/cpukit/posix/src/condsignalsupp.c @ 6a3a81c

4.104.114.84.95
Last change on this file since 6a3a81c was f42b726, checked in by Joel Sherrill <joel.sherrill@…>, on 01/24/01 at 14:17:28

2001-01-24 Ralf Corsepius <corsepiu@…>

  • configure.in: Add src/config.h
  • src/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • src/.cvsignore: Add config.h and stamp-h
  • src/*.c: Add config.h support.
  • Property mode set to 100644
File size: 1.4 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 *  _POSIX_Condition_variables_Signal_support
23 *
24 *  A support routine which implements guts of the broadcast and single task
25 *  wake up version of the "signal" operation.
26 */
27 
28int _POSIX_Condition_variables_Signal_support(
29  pthread_cond_t            *cond,
30  boolean                    is_broadcast
31)
32{
33  register POSIX_Condition_variables_Control *the_cond;
34  Objects_Locations                           location;
35  Thread_Control                             *the_thread;
36 
37  the_cond = _POSIX_Condition_variables_Get( cond, &location );
38  switch ( location ) {
39    case OBJECTS_REMOTE:
40#if defined(RTEMS_MULTIPROCESSING)
41      _Thread_Dispatch();
42      return POSIX_MP_NOT_IMPLEMENTED();
43      return EINVAL;
44#endif
45
46    case OBJECTS_ERROR:
47      return EINVAL;
48    case OBJECTS_LOCAL:
49 
50      do {
51        the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue );
52        if ( !the_thread )
53          the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
54      } while ( is_broadcast && the_thread );
55
56      _Thread_Enable_dispatch();
57
58      return 0;
59  }
60  return POSIX_BOTTOM_REACHED();
61}
Note: See TracBrowser for help on using the repository browser.