Reduce log noise for worker tasks.

This commit is contained in:
Sönke Ludwig 2019-10-22 11:30:31 +02:00
parent 2bf660a529
commit 81ba969fd6

View file

@ -305,19 +305,19 @@ private final class WorkerThread : Thread {
import std.algorithm.searching : count; import std.algorithm.searching : count;
import std.array : array; import std.array : array;
logDebug("worker thread enter"); logTrace("worker thread enter");
TaskFuncInfo taskfunc; TaskFuncInfo taskfunc;
auto emit_count = m_pool.m_signal.emitCount; auto emit_count = m_pool.m_signal.emitCount;
while(true) { while(true) {
with (m_pool.m_state.lock) { with (m_pool.m_state.lock) {
logDebug("worker thread check"); logTrace("worker thread check");
if (term) break; if (term) break;
if (m_queue.consume(taskfunc)) { if (m_queue.consume(taskfunc)) {
logDebug("worker thread got specific task"); logTrace("worker thread got specific task");
} else if (queue.consume(taskfunc)) { } else if (queue.consume(taskfunc)) {
logDebug("worker thread got unspecific task"); logTrace("worker thread got unspecific task");
} }
} }
@ -326,7 +326,7 @@ private final class WorkerThread : Thread {
else emit_count = m_pool.m_signal.waitUninterruptible(emit_count); else emit_count = m_pool.m_signal.waitUninterruptible(emit_count);
} }
logDebug("worker thread exit"); logTrace("worker thread exit");
if (!m_queue.empty) if (!m_queue.empty)
logWarn("Worker thread shuts down with specific worker tasks left in its queue."); logWarn("Worker thread shuts down with specific worker tasks left in its queue.");