mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-06 05:54:15 +00:00
67ba7b89a7
* Introduce Hw namespace and library files under src/lib/hw * Introduce Bootstrap namespace * Move all initialization logic into Bootstrap namespace Ref #2388
33 lines
636 B
C++
33 lines
636 B
C++
/*
|
|
* \brief Lock dummy implementation
|
|
* \author Stefan Kalkowski
|
|
* \date 2016-09-23
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
#include <base/lock.h>
|
|
#include <hw/assert.h>
|
|
|
|
Genode::Cancelable_lock::Cancelable_lock(Genode::Cancelable_lock::State state)
|
|
: _state(state), _owner(nullptr) { }
|
|
|
|
|
|
void Genode::Cancelable_lock::unlock()
|
|
{
|
|
assert(_state == LOCKED);
|
|
_state = UNLOCKED;
|
|
}
|
|
|
|
|
|
void Genode::Cancelable_lock::lock()
|
|
{
|
|
assert(_state == UNLOCKED);
|
|
_state = LOCKED;
|
|
}
|