source: rtems/cpukit/posix/src/mutexunlock.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 <errno.h>
10#include <pthread.h>
11
12#include <rtems/system.h>
13#include <rtems/score/coremutex.h>
14#include <rtems/score/watchdog.h>
15#if defined(RTEMS_MULTIPROCESSING)
16#include <rtems/score/mpci.h>
17#endif
18#include <rtems/posix/mutex.h>
19#include <rtems/posix/priority.h>
20#include <rtems/posix/time.h>
21
22/*PAGE
23 *
24 *  11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
25 *
26 *  NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29
27 */
28
29int pthread_mutex_unlock(
30  pthread_mutex_t           *mutex
31)
32{
33  register POSIX_Mutex_Control *the_mutex;
34  Objects_Locations             location;
35  CORE_mutex_Status             status;
36
37  the_mutex = _POSIX_Mutex_Get( mutex, &location );
38  switch ( location ) {
39
40    case OBJECTS_LOCAL:
41      status = _CORE_mutex_Surrender(
42        &the_mutex->Mutex,
43        the_mutex->Object.id,
44        NULL
45      );
46      _Thread_Enable_dispatch();
47      return _POSIX_Mutex_Translate_core_mutex_return_code( status );
48
49#if defined(RTEMS_MULTIPROCESSING)
50    case OBJECTS_REMOTE:
51#endif
52    case OBJECTS_ERROR:
53      break;
54  }
55
56  return EINVAL;
57}
Note: See TracBrowser for help on using the repository browser.