Changeset 9871f5dc in rtems


Ignore:
Timestamp:
Dec 14, 2015, 3:31:44 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
3015ed64
Parents:
f4fee477
git-author:
Sebastian Huber <sebastian.huber@…> (12/14/15 15:31:44)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/03/16 09:00:55)
Message:

Optional POSIX Mutex initialization

Update #2408.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/include/rtems/posix/muteximpl.h

    rf4fee477 r9871f5dc  
    3232 *  this class of objects.
    3333 */
    34 POSIX_EXTERN Objects_Information _POSIX_Mutex_Information;
     34extern Objects_Information _POSIX_Mutex_Information;
    3535
    3636/**
    3737 *  The default mutex attributes structure.
    3838 */
    39 POSIX_EXTERN pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
     39extern pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
    4040
    4141/**
     
    4444 */
    4545extern const int _POSIX_Mutex_Return_codes[CORE_MUTEX_STATUS_LAST + 1];
    46 
    47 /**
    48  *  @brief POSIX Mutex Manager Initialization
    49  *
    50  *  This routine performs the initialization necessary for this manager.
    51  */
    52 void _POSIX_Mutex_Manager_initialization(void);
    5346
    5447/**
  • cpukit/posix/src/mutex.c

    rf4fee477 r9871f5dc  
    2525#include <rtems/system.h>
    2626#include <rtems/config.h>
     27#include <rtems/sysinit.h>
    2728#include <rtems/score/coremuteximpl.h>
    2829#include <rtems/score/watchdog.h>
    2930#include <rtems/posix/muteximpl.h>
    3031#include <rtems/posix/priorityimpl.h>
     32
     33Objects_Information _POSIX_Mutex_Information;
     34
     35pthread_mutexattr_t _POSIX_Mutex_Default_attributes;
    3136
    3237/*
     
    4146 */
    4247
    43 void _POSIX_Mutex_Manager_initialization(void)
     48static void _POSIX_Mutex_Manager_initialization(void)
    4449{
    4550  pthread_mutexattr_t *default_attr = &_POSIX_Mutex_Default_attributes;
     
    7883  );
    7984}
     85
     86RTEMS_SYSINIT_ITEM(
     87  _POSIX_Mutex_Manager_initialization,
     88  RTEMS_SYSINIT_POSIX_MUTEX,
     89  RTEMS_SYSINIT_ORDER_MIDDLE
     90);
  • cpukit/sapi/src/posixapi.c

    rf4fee477 r9871f5dc  
    3535#include <rtems/posix/config.h>
    3636#include <rtems/posix/mqueueimpl.h>
    37 #include <rtems/posix/muteximpl.h>
    3837#include <rtems/posix/priorityimpl.h>
    3938#include <rtems/posix/psignalimpl.h>
     
    6362
    6463  #ifdef RTEMS_POSIX_API
    65     _POSIX_Mutex_Manager_initialization();
    6664    _POSIX_Message_queue_Manager_initialization();
    6765    _POSIX_Semaphore_Manager_initialization();
  • cpukit/score/include/rtems/sysinit.h

    rf4fee477 r9871f5dc  
    4646#define RTEMS_SYSINIT_POSIX_THREADS              000361
    4747#define RTEMS_SYSINIT_POSIX_CONDITION_VARIABLE   000362
     48#define RTEMS_SYSINIT_POSIX_MUTEX                000363
    4849#define RTEMS_SYSINIT_POSIX_CLEANUP              00036a
    4950#define RTEMS_SYSINIT_IDLE_THREADS               000380
  • testsuites/sptests/spsysinit01/init.c

    rf4fee477 r9871f5dc  
    3030#ifdef RTEMS_POSIX_API
    3131#include <rtems/posix/condimpl.h>
     32#include <rtems/posix/muteximpl.h>
    3233#include <rtems/posix/psignalimpl.h>
    3334#include <rtems/posix/pthreadimpl.h>
     
    9091  POSIX_CONDITION_VARIABLE_PRE,
    9192  POSIX_CONDITION_VARIABLE_POST,
     93  POSIX_MUTEX_PRE,
     94  POSIX_MUTEX_POST,
    9295  POSIX_CLEANUP_PRE,
    9396  POSIX_CLEANUP_POST,
     
    378381}
    379382
     383FIRST(RTEMS_SYSINIT_POSIX_MUTEX)
     384{
     385  assert(_POSIX_Mutex_Information.maximum == 0);
     386  next_step(POSIX_MUTEX_PRE);
     387}
     388
     389LAST(RTEMS_SYSINIT_POSIX_MUTEX)
     390{
     391  assert(_POSIX_Mutex_Information.maximum != 0);
     392  next_step(POSIX_MUTEX_POST);
     393}
     394
    380395static size_t user_extensions_pre_posix_cleanup;
    381396
     
    507522#ifdef RTEMS_POSIX_API
    508523
     524#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
     525
    509526#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1
    510527
Note: See TracChangeset for help on using the changeset viewer.