mutex: reinit Applicant state in Mutex::acquire()

The applicant_to_wake_up() member must be initialized to 0 to keep the
same semantic as before the change by

"base: add mutex as derivate of lock"

Issue #3662
This commit is contained in:
Alexander Boettcher 2020-02-25 08:56:26 +01:00 committed by Christian Helmuth
parent daee1f4cb8
commit accda1211b
1 changed files with 7 additions and 6 deletions

View File

@ -17,16 +17,17 @@
void Genode::Mutex::acquire()
{
Lock::Applicant myself(Thread::myself());
if (_lock.lock_owner(myself))
Genode::error("deadlock ahead, mutex=", this, ", return ip=",
__builtin_return_address(0));
while (1)
while (1) {
try {
Lock::Applicant myself(Thread::myself());
if (_lock.lock_owner(myself))
Genode::error("deadlock ahead, mutex=", this, ", return ip=",
__builtin_return_address(0));
_lock.Cancelable_lock::lock(myself);
return;
} catch (Blocking_canceled) { }
}
}
void Genode::Mutex::release()