Skip to content

Commit 8032ee2

Browse files
committed
JackClient: Lock before killing client notification thread
The client notification thread locks a mutex before reading/writing from/to the socket. If the thread is killed while the lock is taken it would leave the mutex dangling. To avoid this take the mutex and then kill the client notification thread. Signed-off-by: Laxmi Devi <Laxmi.Devi@in.bosch.com>
1 parent 03b8316 commit 8032ee2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

common/JackClient.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ int JackClient::Close()
109109
Deactivate();
110110

111111
// Channels is stopped first to avoid receiving notifications while closing
112-
fChannel->Stop();
112+
JackGlobals::fSynchroMutex->Lock();
113+
fChannel->Stop();
114+
JackGlobals::fSynchroMutex->Unlock();
113115
// Then close client
114116
fChannel->ClientClose(GetClientControl()->fRefNum, &result);
115117

0 commit comments

Comments
 (0)