Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ public void start(IThreadManager threadManager) {
*/
public boolean waitForStop() {
boolean isAlive = false;

if (runThread != null && runThread.isAlive()) {
runThread.interrupt();
waitForStop(runThread);
isAlive = runThread.isAlive();
Thread thr = runThread; // forceStop() can set to null concurrently
if (thr != null && thr.isAlive()) {
thr.interrupt();
waitForStop(thr);
isAlive = thr.isAlive();
}

Thread[] threads = new Thread[100];
Expand All @@ -108,7 +108,7 @@ public boolean waitForStop() {
}

for (Thread thread : threads) {
if (thread != null && thread != runThread && thread.isAlive()) {
if (thread != null && thread != thr && thread.isAlive()) {
thread.interrupt();
waitForStop(thread);
isAlive |= thread.isAlive();
Expand Down