linux: use Mutex

Fixes #3807
This commit is contained in:
Alexander Boettcher
2020-07-07 11:41:44 +02:00
committed by Norman Feske
parent a0b0892df3
commit ce6f4dffe5
5 changed files with 11 additions and 13 deletions

View File

@ -61,12 +61,12 @@ static bool is_sub_rm_session(Dataspace_capability ds)
/**
* Lock for protecting mmap/unmap sequences and region-map meta data
* Mutex for protecting mmap/unmap sequences and region-map meta data
*/
static Lock &lock()
static Mutex &mutex()
{
static Lock lock;
return lock;
static Mutex mutex { };
return mutex;
}
@ -175,7 +175,7 @@ Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
Region_map::Local_addr local_addr,
bool executable, bool writeable)
{
Lock::Guard lock_guard(lock());
Mutex::Guard mutex_guard(mutex());
/* only support attach_at for sub RM sessions */
if (_sub_rm && !use_local_addr) {
@ -320,7 +320,7 @@ Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
void Region_map_mmap::detach(Region_map::Local_addr local_addr)
{
Lock::Guard lock_guard(lock());
Mutex::Guard mutex_guard(mutex());
/*
* Cases