Avoid crashing on debug if we shutdown on non-empty queue: print out a debug warning instead.
@@ -283,9 +283,13 @@ namespace PAL_NS_BEGIN {
m_hThread.detach();
}
catch (...) {};
- assert(m_queue.empty());
- // FIXME: [MG] - investigate why sometimes we shutdown on non-empty queue?!
- assert(m_timerQueue.empty());
+
+ // TODO: [MG] - investigate how often that happens.
+ // Side-effect is that we have a queued work item discarded on shutdown.
+ if (!m_queue.empty())
+ LOG_WARN("m_queue is not empty!");
+ if (!m_timerQueue.empty())
+ LOG_WARN("m_timerQueue is not empty!");
}
void queue(detail::WorkerThreadItemPtr item)
