mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
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()
|
||||
{
|
||||
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user