From a624e0c2a1f33f39d364b1365c97a6b2d2a33888 Mon Sep 17 00:00:00 2001 From: Ravali Yatham Date: Tue, 27 Feb 2024 21:24:15 -0800 Subject: [PATCH] While processLoop is running don't destruct the threads too early on zos and windows to avoid intermittent crashes. Fixes #102 Signed-off-by: Ravali Yatham --- src/ibmras/monitoring/agent/threads/WorkerThread.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ibmras/monitoring/agent/threads/WorkerThread.cpp b/src/ibmras/monitoring/agent/threads/WorkerThread.cpp index 7507e65..4ab6d35 100644 --- a/src/ibmras/monitoring/agent/threads/WorkerThread.cpp +++ b/src/ibmras/monitoring/agent/threads/WorkerThread.cpp @@ -43,7 +43,11 @@ void WorkerThread::start() { } void WorkerThread::stop() { - source->complete(NULL); + // Issue 102: By completing pull sources too early might + // intermittenlty destruct while still in processLoop. + #if !defined(_WINDOWS) && !defined(_ZOS) + source->complete(NULL); + #endif running = false; // Issue 99: By setting stopped to true too early, ThreadPool