mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-10 12:51:34 +00:00
core: fix deadlock in region_map destruction
Introduced by: commit 99fbb23ec53bd5f10038890c4d9986613b4548f7 Author: Alexander Boettcher <alexander.boettcher@genode-labs.com> Date: Fri Sep 9 17:49:34 2016 +0200 core: use weak_ptr for Rm_faulter and Region_map Issue #2086
This commit is contained in:
parent
d8f2610e9c
commit
e4a1904456
@ -285,11 +285,14 @@ void Rm_faulter::dissolve_from_faulting_region_map(Region_map_component * caller
|
||||
/* serialize access */
|
||||
Lock::Guard lock_guard(_lock);
|
||||
|
||||
{
|
||||
enum { DO_LOCK = true };
|
||||
if (caller == static_cast<Region_map_component *>(_faulting_region_map.obj())) {
|
||||
caller->discard_faulter(this, !DO_LOCK);
|
||||
} else {
|
||||
Locked_ptr<Region_map_component> locked_ptr(_faulting_region_map);
|
||||
|
||||
if (locked_ptr.valid())
|
||||
locked_ptr->discard_faulter(this, &*locked_ptr != caller);
|
||||
locked_ptr->discard_faulter(this, DO_LOCK);
|
||||
}
|
||||
|
||||
_faulting_region_map = Genode::Weak_ptr<Genode::Region_map_component>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user