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:
parent
daee1f4cb8
commit
accda1211b
|
@ -17,16 +17,17 @@
|
||||||
|
|
||||||
void Genode::Mutex::acquire()
|
void Genode::Mutex::acquire()
|
||||||
{
|
{
|
||||||
Lock::Applicant myself(Thread::myself());
|
while (1) {
|
||||||
if (_lock.lock_owner(myself))
|
|
||||||
Genode::error("deadlock ahead, mutex=", this, ", return ip=",
|
|
||||||
__builtin_return_address(0));
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
try {
|
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);
|
_lock.Cancelable_lock::lock(myself);
|
||||||
return;
|
return;
|
||||||
} catch (Blocking_canceled) { }
|
} catch (Blocking_canceled) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Genode::Mutex::release()
|
void Genode::Mutex::release()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user