mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-25 00:11:07 +00:00
parent
ee8eea9330
commit
764f8335d0
@ -107,26 +107,19 @@ void Cancelable_lock::lock()
|
||||
*/
|
||||
spinlock_lock(&_spinlock_state);
|
||||
if (_owner != myself) {
|
||||
|
||||
|
||||
/* check if we are the applicant to be waken up next */
|
||||
Applicant *a = _owner.applicant_to_wake_up();
|
||||
if (a && (*a == myself)) {
|
||||
|
||||
_owner.applicant_to_wake_up(myself.applicant_to_wake_up());
|
||||
|
||||
/* otherwise, go through the list of remaining applicants */
|
||||
} else {
|
||||
|
||||
for (; a; a = a->applicant_to_wake_up()) {
|
||||
|
||||
/*
|
||||
* Check if we are the applicant to be waken up next,
|
||||
* otherwise, go through the list of remaining applicants
|
||||
*/
|
||||
for (Applicant *a = &_owner; a; a = a->applicant_to_wake_up()) {
|
||||
/* remove reference to ourself from the applicants list */
|
||||
if (a->applicant_to_wake_up() == &myself) {
|
||||
a->applicant_to_wake_up(myself.applicant_to_wake_up());
|
||||
if (_last_applicant == &myself)
|
||||
_last_applicant = a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spinlock_unlock(&_spinlock_state);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user