diff --git a/repos/base/include/base/registry.h b/repos/base/include/base/registry.h index ada4d227a..45c0bf920 100644 --- a/repos/base/include/base/registry.h +++ b/repos/base/include/base/registry.h @@ -16,7 +16,7 @@ #include #include -#include +#include namespace Genode { @@ -52,7 +52,7 @@ class Genode::Registry_base /** * Protect '_reinsert_ptr' */ - Lock _lock { }; + Mutex _mutex { }; /* * Assigned by 'Registry::_for_each' @@ -78,7 +78,7 @@ class Genode::Registry_base protected: - Lock mutable _lock { }; /* protect '_elements' */ + Mutex mutable _mutex { }; /* protect '_elements' */ List _elements { }; private: @@ -133,7 +133,7 @@ struct Genode::Registry : private Registry_base template void for_each(FUNC const &fn) const { - Lock::Guard lock_guard(_lock); + Mutex::Guard guard(_mutex); Registry_base::Element const *e = _elements.first(), *next = nullptr; for ( ; e; e = next) { diff --git a/repos/base/src/lib/base/registry.cc b/repos/base/src/lib/base/registry.cc index 3ac68c64b..0b6510d8f 100644 --- a/repos/base/src/lib/base/registry.cc +++ b/repos/base/src/lib/base/registry.cc @@ -28,7 +28,7 @@ Registry_base::Element::Element(Registry_base ®istry, void *obj) Registry_base::Element::~Element() { { - Lock::Guard guard(_lock); + Mutex::Guard guard(_mutex); if (_notify_ptr && _registry._curr == this) { /* @@ -43,7 +43,7 @@ Registry_base::Element::~Element() return; /* - * We synchronize on the _lock of the _registry, by invoking + * We synchronize on the _mutex of the _registry, by invoking * the _remove method below. This ensures that the object leaves * the destructor not before the registry lost the pointer to this * object. The actual removal attempt will be ignored by the list @@ -57,7 +57,7 @@ Registry_base::Element::~Element() void Registry_base::_insert(Element &element) { - Lock::Guard lock_guard(_lock); + Mutex::Guard guard(_mutex); _elements.insert(&element); } @@ -65,7 +65,7 @@ void Registry_base::_insert(Element &element) void Registry_base::_remove(Element &element) { - Lock::Guard lock_guard(_lock); + Mutex::Guard guard(_mutex); _elements.remove(&element); } @@ -82,7 +82,7 @@ Registry_base::Element *Registry_base::_processed(Notify ¬ify, return at; /* make sure that the critical section of '~Element' is completed */ - Lock::Guard guard(e._lock); + Mutex::Guard guard(e._mutex); /* here we know that 'e' still exists */ e._notify_ptr = nullptr; @@ -90,7 +90,7 @@ Registry_base::Element *Registry_base::_processed(Notify ¬ify, /* * If '~Element' was preempted between the condition check and the * assignment of keep = DISCARD, the above check would miss the DISCARD - * flag. Now, with the acquired lock, we know that the 'keep' value is + * flag. Now, with the acquired mutex, we know that the 'keep' value is * up to date. */ if (notify.keep == Notify::Keep::DISCARD) @@ -106,7 +106,7 @@ Registry_base::Element *Registry_base::_processed(Notify ¬ify, void Registry_base::_for_each(Untyped_functor &functor) { - Lock::Guard lock_guard(_lock); + Mutex::Guard guard(_mutex); /* insert position in list of processed elements */ Element *at = nullptr; @@ -118,7 +118,7 @@ void Registry_base::_for_each(Untyped_functor &functor) Notify notify(Notify::Keep::KEEP, Thread::myself()); { /* tell the element where to report its status */ - Lock::Guard guard(e->_lock); + Mutex::Guard guard(e->_mutex); _curr = e; e->_notify_ptr = ¬ify; }