source: rtems/cpukit/posix/src/mutex.c @ 309e2f6

4.104.115
Last change on this file since 309e2f6 was 309e2f6, checked in by Joel Sherrill <joel.sherrill@…>, on 12/17/08 at 21:23:37

2008-12-17 Joel Sherrill <joel.sherrill@…>

  • posix/include/rtems/posix/barrier.h, posix/include/rtems/posix/cond.h, posix/include/rtems/posix/key.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/psignal.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/ptimer.h, posix/include/rtems/posix/rwlock.h, posix/include/rtems/posix/semaphore.h, posix/include/rtems/posix/spinlock.h, posix/include/rtems/posix/timer.h, posix/src/cond.c, posix/src/key.c, posix/src/mqueue.c, posix/src/mutex.c, posix/src/pbarrier.c, posix/src/prwlock.c, posix/src/psignal.c, posix/src/pspin.c, posix/src/pthread.c, posix/src/pthreadinitthreads.c, posix/src/ptimer.c, posix/src/semaphore.c, sapi/src/posixapi.c: Convert POSIX manager initialization routines to directly pull parameters from configuration table.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
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 *  $Id$
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <errno.h>
17#include <pthread.h>
18#include <limits.h>
19
20#include <rtems/system.h>
21#include <rtems/config.h>
22#include <rtems/score/coremutex.h>
23#include <rtems/score/watchdog.h>
24#if defined(RTEMS_MULTIPROCESSING)
25#include <rtems/score/mpci.h>
26#endif
27#include <rtems/posix/mutex.h>
28#include <rtems/posix/priority.h>
29#include <rtems/posix/time.h>
30
31/*PAGE
32 *
33 *  _POSIX_Mutex_Manager_initialization
34 *
35 *  This routine initializes all mutex manager related data structures.
36 *
37 *  Input parameters:
38 *    maximum_mutexes - maximum configured mutexes
39 *
40 *  Output parameters:  NONE
41 */
42
43void _POSIX_Mutex_Manager_initialization(void)
44{
45  pthread_mutexattr_t *default_attr = &_POSIX_Mutex_Default_attributes;
46
47  /*
48   * Since the maximum priority is run-time configured, this
49   * structure cannot be initialized statically.
50   */
51  default_attr->is_initialized = TRUE;
52  default_attr->process_shared = PTHREAD_PROCESS_PRIVATE;
53  default_attr->prio_ceiling   = POSIX_SCHEDULER_MAXIMUM_PRIORITY;
54  default_attr->protocol       = PTHREAD_PRIO_NONE;
55  default_attr->recursive      = FALSE;
56
57  /*
58   * Initialize the POSIX mutex object class information structure.
59   */
60  _Objects_Initialize_information(
61    &_POSIX_Mutex_Information,  /* object information table */
62    OBJECTS_POSIX_API,          /* object API */
63    OBJECTS_POSIX_MUTEXES,      /* object class */
64    Configuration_POSIX_API.maximum_mutexes,
65                                /* maximum objects of this class */
66    sizeof( POSIX_Mutex_Control ),
67                                /* size of this object's control block */
68    TRUE,                       /* TRUE if names for this object are strings */
69    _POSIX_PATH_MAX             /* maximum length of each object's name */
70#if defined(RTEMS_MULTIPROCESSING)
71    ,
72    FALSE,                      /* TRUE if this is a global object class */
73    NULL                        /* Proxy extraction support callout */
74#endif
75  );
76}
Note: See TracBrowser for help on using the repository browser.