From 5cdac5678e92da488534b07369b12ab9a8ac26cd Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 31 Oct 2010 15:27:07 -0400 Subject: [PATCH] Do not ever spawn more than 1 network thread. --- Source/DebuggerConnection.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index 8424782..87b960e 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -230,6 +230,12 @@ void PerformQuitSignal(void* info) */ - (void)connect { + if (thread_ && !connected_) { + // A thread has been detached but the socket has yet to connect. Do not + // spawn a new thread otherwise multiple threads will be blocked on the same + // socket. + return; + } [NSThread detachNewThreadSelector:@selector(connectionThreadStart) toTarget:self withObject:nil]; } -- 2.22.5