source: rtems/cpukit/libdrvmgr/drvmgr_lock.c @ 905d7fa

Last change on this file since 905d7fa was 905d7fa, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 24, 2018 at 1:23:39 PM

drvmgr: Use API mutex usage

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

  • Property mode set to 100644
File size: 648 bytes
Line 
1/* Driver Manager Internal locking implementation
2 *
3 * COPYRIGHT (c) 2009 Cobham Gaisler AB.
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.org/license/LICENSE.
8 */
9
10#include <drvmgr/drvmgr.h>
11#include "drvmgr_internal.h"
12#include <rtems/score/sysstate.h>
13
14void _DRV_Manager_Lock( void )
15{
16  if ( !_System_state_Is_before_multitasking( _System_state_Get() ) ) {
17    _API_Mutex_Lock( &drvmgr.lock );
18  }
19}
20
21void _DRV_Manager_Unlock(void)
22{
23  if ( !_System_state_Is_before_multitasking( _System_state_Get() ) ) {
24    _API_Mutex_Unlock( &drvmgr.lock );
25  }
26}
Note: See TracBrowser for help on using the repository browser.