kernel/condition_variable: Pause between iterations.
Should hopefully resolve the remaining problem in #17455. Change-Id: I6e00286508c069705e07c9a0b59af2cf5e15e427 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4819 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
committed by
Jérôme Duval
parent
101dc0ba83
commit
e0842c10af
@@ -157,8 +157,9 @@ ConditionVariableEntry::_RemoveFromVariable()
|
|||||||
int32 tries = 0;
|
int32 tries = 0;
|
||||||
while (atomic_pointer_get(&fVariable) != NULL) {
|
while (atomic_pointer_get(&fVariable) != NULL) {
|
||||||
tries++;
|
tries++;
|
||||||
if ((tries % 100000) == 0)
|
if ((tries % 10000) == 0)
|
||||||
panic("variable pointer was not unset for a long time!");
|
panic("variable pointer was not unset for a long time!");
|
||||||
|
cpu_pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -396,6 +397,7 @@ ConditionVariable::_NotifyLocked(bool all, status_t result)
|
|||||||
tries++;
|
tries++;
|
||||||
if ((tries % 10000) == 0)
|
if ((tries % 10000) == 0)
|
||||||
panic("entries count was not decremented for a long time!");
|
panic("entries count was not decremented for a long time!");
|
||||||
|
cpu_pause();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status_t waitStatus = atomic_get_and_set(&entry->fWaitStatus, result);
|
status_t waitStatus = atomic_get_and_set(&entry->fWaitStatus, result);
|
||||||
|
|||||||
Reference in New Issue
Block a user