summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-30 12:34:45 -0400
committerDavid Robillard <d@drobilla.net>2016-07-30 12:34:45 -0400
commite74c6a3b388ded66fcc4cfb1fa5bece881b63113 (patch)
tree1afcb2ed2bec2ab0f2f8f0dbf0fb581203cf7159
parenta8788e1eb41ec53fa4bf606ba64728f6de71ca80 (diff)
downloadingen-e74c6a3b388ded66fcc4cfb1fa5bece881b63113.tar.gz
ingen-e74c6a3b388ded66fcc4cfb1fa5bece881b63113.tar.bz2
ingen-e74c6a3b388ded66fcc4cfb1fa5bece881b63113.zip
Fix stall by making PreProcessor tick periodically
I am not sure exactly what scenarios cause this to happen, every event should post to the semaphore, but having the PreProcessor thread tick idly doesn't hurt anything and resolves the issue.
-rw-r--r--src/server/PreProcessor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp
index 6c514f00..e26ebcdc 100644
--- a/src/server/PreProcessor.cpp
+++ b/src/server/PreProcessor.cpp
@@ -114,7 +114,11 @@ void
PreProcessor::run()
{
ThreadManager::set_flag(THREAD_PRE_PROCESS);
- while (_sem.wait() && !_exit_flag) {
+ while (!_exit_flag) {
+ if (!_sem.timed_wait(1000)) {
+ continue;
+ }
+
Event* const ev = _prepared_back.load();
if (!ev) {
return;