Changeset 905d7fa in rtems


Ignore:
Timestamp:
Apr 24, 2018, 1:23:39 PM (15 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
f4794b6
Parents:
891754f7
Message:

drvmgr: Use API mutex usage

The driver manager lock may be used before the executing thread is
initialized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libdrvmgr/drvmgr_lock.c

    r891754f7 r905d7fa  
    88 */
    99
    10 #include <rtems.h>
    1110#include <drvmgr/drvmgr.h>
    1211#include "drvmgr_internal.h"
     12#include <rtems/score/sysstate.h>
    1313
    14 void _DRV_Manager_Lock(void)
     14void _DRV_Manager_Lock( void )
    1515{
    16         _API_Mutex_Lock(&drvmgr.lock);
     16  if ( !_System_state_Is_before_multitasking( _System_state_Get() ) ) {
     17    _API_Mutex_Lock( &drvmgr.lock );
     18  }
    1719}
    1820
    1921void _DRV_Manager_Unlock(void)
    2022{
    21         _API_Mutex_Unlock(&drvmgr.lock);
     23  if ( !_System_state_Is_before_multitasking( _System_state_Get() ) ) {
     24    _API_Mutex_Unlock( &drvmgr.lock );
     25  }
    2226}
Note: See TracChangeset for help on using the changeset viewer.