launchpad: use Mutex

Fixes #3804
This commit is contained in:
Alexander Boettcher 2020-07-06 12:53:27 +02:00 committed by Norman Feske
parent 973fbc98be
commit 61d798c629
2 changed files with 5 additions and 6 deletions

View File

@ -22,7 +22,6 @@
#include <util/xml_node.h>
#include <base/allocator.h>
#include <base/service.h>
#include <base/lock.h>
#include <base/child.h>
#include <timer_session/timer_session.h>
#include <pd_session/client.h>
@ -229,8 +228,8 @@ class Launchpad
Launchpad_child::Parent_services _parent_services { };
Launchpad_child::Child_services _child_services { };
Genode::Lock _children_lock { };
Genode::List<Launchpad_child> _children { };
Genode::Mutex _children_mutex { };
Genode::List<Launchpad_child> _children { };
bool _child_name_exists(Launchpad_child::Name const &);

View File

@ -72,7 +72,7 @@ bool Launchpad::_child_name_exists(Launchpad_child::Name const &name)
Launchpad_child::Name
Launchpad::_get_unique_child_name(Launchpad_child::Name const &binary_name)
{
Lock::Guard lock_guard(_children_lock);
Mutex::Guard guard(_children_mutex);
if (!_child_name_exists(binary_name))
return binary_name;
@ -195,7 +195,7 @@ Launchpad_child *Launchpad::start_child(Launchpad_child::Name const &binary_name
cap_quota, ram_quota,
_parent_services, _child_services, config_ds);
Lock::Guard lock_guard(_children_lock);
Mutex::Guard guard(_children_mutex);
_children.insert(c);
add_child(unique_name, ram_quota.value, *c, _heap);
@ -212,7 +212,7 @@ void Launchpad::exit_child(Launchpad_child &child)
{
remove_child(child.name(), _heap);
Lock::Guard lock_guard(_children_lock);
Mutex::Guard guard(_children_mutex);
_children.remove(&child);
destroy(_sliced_heap, &child);