From d93ce29b20a1a507f67a345559496c2fb4e90a56 Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Sun, 29 Dec 2019 13:47:40 +0100 Subject: [PATCH] Exclusive thread possible fix for Linux The deadlock is possibly caused by the thread not being joined, or because of an implementation difference with phtreads. So this fix adds a call to release the background thread when terminating it and then also joins the thread to await for the completion of the background thread. As before this works fine under Win32 (x64) --- simgear/threads/SGThread.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simgear/threads/SGThread.cxx b/simgear/threads/SGThread.cxx index c5686e51..cdb16592 100644 --- a/simgear/threads/SGThread.cxx +++ b/simgear/threads/SGThread.cxx @@ -495,6 +495,8 @@ SGExclusiveThread::SGExclusiveThread() : void SGExclusiveThread::terminate() { _terminated = true; + release(); + join(); } bool SGExclusiveThread::stop() {