source: rtems/cpukit/posix/src/mutex.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief POSIX Mutex Manager Initialization
5 * @ingroup POSIX_MUTEX POSIX Mutex Support
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <errno.h>
22#include <pthread.h>
23#include <limits.h>
24
25#include <rtems/system.h>
26#include <rtems/config.h>
27#include <rtems/score/coremuteximpl.h>
28#include <rtems/score/watchdog.h>
29#include <rtems/posix/muteximpl.h>
30#include <rtems/posix/priorityimpl.h>
31#include <rtems/posix/time.h>
32
33/*
34 *  _POSIX_Mutex_Manager_initialization
35 *
36 *  This routine initializes all mutex manager related data structures.
37 *
38 *  Input parameters:
39 *    maximum_mutexes - maximum configured mutexes
40 *
41 *  Output parameters:  NONE
42 */
43
44void _POSIX_Mutex_Manager_initialization(void)
45{
46  pthread_mutexattr_t *default_attr = &_POSIX_Mutex_Default_attributes;
47
48  /*
49   * Since the maximum priority is run-time configured, this
50   * structure cannot be initialized statically.
51   */
52  default_attr->is_initialized = true;
53  default_attr->process_shared = PTHREAD_PROCESS_PRIVATE;
54  default_attr->prio_ceiling   = POSIX_SCHEDULER_MAXIMUM_PRIORITY;
55  default_attr->protocol       = PTHREAD_PRIO_NONE;
56  default_attr->recursive      = false;
57  #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
58    default_attr->type         = PTHREAD_MUTEX_DEFAULT;
59  #endif
60
61  /*
62   * Initialize the POSIX mutex object class information structure.
63   */
64  _Objects_Initialize_information(
65    &_POSIX_Mutex_Information,  /* object information table */
66    OBJECTS_POSIX_API,          /* object API */
67    OBJECTS_POSIX_MUTEXES,      /* object class */
68    Configuration_POSIX_API.maximum_mutexes,
69                                /* maximum objects of this class */
70    sizeof( POSIX_Mutex_Control ),
71                                /* size of this object's control block */
72    true,                       /* true if names for this object are strings */
73    _POSIX_PATH_MAX             /* maximum length of each object's name */
74#if defined(RTEMS_MULTIPROCESSING)
75    ,
76    false,                      /* true if this is a global object class */
77    NULL                        /* Proxy extraction support callout */
78#endif
79  );
80}
Note: See TracBrowser for help on using the repository browser.