source: rtems/c/src/exec/posix/src/mutexgetprioceiling.c @ 811fae1

4.104.114.84.95
Last change on this file since 811fae1 was 9f95a19, checked in by Joel Sherrill <joel.sherrill@…>, on 11/02/99 at 18:35:52

Split time.c into multiple files.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  $Id$
3 */
4
5#include <assert.h>
6#include <errno.h>
7#include <pthread.h>
8
9#include <rtems/system.h>
10#include <rtems/score/coremutex.h>
11#include <rtems/score/watchdog.h>
12#if defined(RTEMS_MULTIPROCESSING)
13#include <rtems/score/mpci.h>
14#endif
15#include <rtems/posix/mutex.h>
16#include <rtems/posix/priority.h>
17#include <rtems/posix/time.h>
18
19/*PAGE
20 *
21 *  13.6.2 Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131
22 */
23
24int pthread_mutex_getprioceiling(
25  pthread_mutex_t   *mutex,
26  int               *prioceiling
27)
28{
29  register POSIX_Mutex_Control *the_mutex;
30  Objects_Locations             location;
31
32  if ( !prioceiling )
33    return EINVAL;
34
35  the_mutex = _POSIX_Mutex_Get( mutex, &location );
36  switch ( location ) {
37    case OBJECTS_REMOTE:
38#if defined(RTEMS_MULTIPROCESSING)
39      return POSIX_MP_NOT_IMPLEMENTED();   /* XXX feels questionable */
40#endif
41    case OBJECTS_ERROR:
42      return EINVAL;
43    case OBJECTS_LOCAL:
44      *prioceiling = _POSIX_Priority_From_core(
45        the_mutex->Mutex.Attributes.priority_ceiling
46      );
47      _Thread_Enable_dispatch();
48      return 0;
49  }
50  return POSIX_BOTTOM_REACHED();
51}
Note: See TracBrowser for help on using the repository browser.