wm: fix possible deadlock

Fixes #2183
This commit is contained in:
Christian Prochaska 2016-12-05 13:26:53 +01:00 committed by Norman Feske
parent 088bf52be1
commit 0d9e566b18

View File

@ -128,7 +128,7 @@ class Wm::Nitpicker::View : public Genode::Weak_object<View>,
/**
* Apply cached view state to the physical nitpicker view
*/
void _apply_view_config()
void _unsynchronized_apply_view_config(Locked_ptr<View> &neighbor)
{
if (!_real_handle.valid())
return;
@ -139,7 +139,6 @@ class Wm::Nitpicker::View : public Genode::Weak_object<View>,
View_handle real_neighbor_handle;
Locked_ptr<View> neighbor(_neighbor_ptr);
if (neighbor.valid())
real_neighbor_handle = _real_nitpicker.view_handle(neighbor->real_view_cap());
@ -154,6 +153,12 @@ class Wm::Nitpicker::View : public Genode::Weak_object<View>,
_real_nitpicker.release_view_handle(real_neighbor_handle);
}
void _apply_view_config()
{
Locked_ptr<View> neighbor(_neighbor_ptr);
_unsynchronized_apply_view_config(neighbor);
}
public:
~View()
@ -402,7 +407,10 @@ class Wm::Nitpicker::Child_view : public View,
_real_nitpicker.release_view_handle(parent_handle);
_apply_view_config();
if (_neighbor_ptr == _parent)
_unsynchronized_apply_view_config(parent);
else
_apply_view_config();
}
void update_child_stacking()