Skip to content
Snippets Groups Projects
Commit 45a58e4a authored by Florian Schmaus's avatar Florian Schmaus
Browse files

[Runtime] Fix skipWakeupThreshold value

Adjust to sem_getvalue() being allowed to return 0 if there are
waiting workers.
parent 66bb12b1
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,14 @@ class Runtime : public Logger<LogSubsystem::RUNTI> {
// This is sound because wakeupSleepingWorkers() is called from a active
// worker which will observe its own new work in its next dispatchLoop before
// going to sleep.
skipWakeupThreshold = -1;
// Note that sem_getvalue() is allowed to return 0 if there are
// waiting workers, hence we need to set the threshold also to
// 0. This has the disadvantage that we will perform one
// unnecessary sem_post. If we ever switch the wakeupSem
// implementation, then the skipWakeupThreshold value should be
// reviewed and potentially changed to '-1'.
skipWakeupThreshold = 0;
}
int semValue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment