diff options
Diffstat (limited to 'cpukit/libdrvmgr')
-rw-r--r-- | cpukit/libdrvmgr/drvmgr_lock.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cpukit/libdrvmgr/drvmgr_lock.c b/cpukit/libdrvmgr/drvmgr_lock.c index c7a1104eef..23cdb137e6 100644 --- a/cpukit/libdrvmgr/drvmgr_lock.c +++ b/cpukit/libdrvmgr/drvmgr_lock.c @@ -7,16 +7,20 @@ * http://www.rtems.org/license/LICENSE. */ -#include <rtems.h> #include <drvmgr/drvmgr.h> #include "drvmgr_internal.h" +#include <rtems/score/sysstate.h> -void _DRV_Manager_Lock(void) +void _DRV_Manager_Lock( void ) { - _API_Mutex_Lock(&drvmgr.lock); + if ( !_System_state_Is_before_multitasking( _System_state_Get() ) ) { + _API_Mutex_Lock( &drvmgr.lock ); + } } void _DRV_Manager_Unlock(void) { - _API_Mutex_Unlock(&drvmgr.lock); + if ( !_System_state_Is_before_multitasking( _System_state_Get() ) ) { + _API_Mutex_Unlock( &drvmgr.lock ); + } } |