Skip to content

Commit

Permalink
While processLoop is running don't destruct the threads too early
Browse files Browse the repository at this point in the history
on zos and windows to avoid intermittent crashes.

Fixes #102

Signed-off-by: Ravali Yatham <rayatha1@in.ibm.com>
  • Loading branch information
yathamravali authored and BrijeshNekkare committed Aug 28, 2024
1 parent 6ab6140 commit a624e0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ibmras/monitoring/agent/threads/WorkerThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a624e0c

Please sign in to comment.