summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Communication.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-07-23 15:43:25 +0000
committerGreg Clayton <gclayton@apple.com>2010-07-23 15:43:25 +0000
commit26661bca2075d2cab6c7d0106141c8892ecd1cbd (patch)
tree99482532560c9aaa2b289f194216ef95893115a9 /lldb/source/Core/Communication.cpp
parent19503a2a78319cc52c3b7a295d7df1ce0574c290 (diff)
downloadbcm5719-llvm-26661bca2075d2cab6c7d0106141c8892ecd1cbd.tar.gz
bcm5719-llvm-26661bca2075d2cab6c7d0106141c8892ecd1cbd.zip
Remove a premature invalidation of a threads pthread_t handle, thus avoiding
a segfault when calling pthread_cancel. Also, sets m_read_thread_enabled if the thread is actually spawned. Patch from Stephen Wilson. llvm-svn: 109227
Diffstat (limited to 'lldb/source/Core/Communication.cpp')
-rw-r--r--lldb/source/Core/Communication.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp
index 9fa06479511..d05eb3b1556 100644
--- a/lldb/source/Core/Communication.cpp
+++ b/lldb/source/Core/Communication.cpp
@@ -211,9 +211,9 @@ Communication::StartReadThread (Error *error_ptr)
char thread_name[1024];
snprintf(thread_name, sizeof(thread_name), "<lldb.comm.%s>", m_broadcaster_name.AsCString());
- m_read_thread_enabled = true;
m_read_thread = Host::ThreadCreate (thread_name, Communication::ReadThread, this, error_ptr);
- return m_read_thread != LLDB_INVALID_HOST_THREAD;
+ m_read_thread_enabled = m_read_thread != LLDB_INVALID_HOST_THREAD;
+ return m_read_thread_enabled;
}
bool
@@ -232,6 +232,7 @@ Communication::StopReadThread (Error *error_ptr)
Host::ThreadCancel (m_read_thread, error_ptr);
return Host::ThreadJoin (m_read_thread, NULL, error_ptr);
+ m_read_thread = LLDB_INVALID_HOST_THREAD;
}
@@ -339,7 +340,6 @@ Communication::ReadThread (void *p)
log->Printf ("%p Communication::ReadThread () thread exiting...", p);
// Let clients know that this thread is exiting
- comm->m_read_thread = LLDB_INVALID_HOST_THREAD;
comm->BroadcastEvent (eBroadcastBitReadThreadDidExit);
return NULL;
}
OpenPOWER on IntegriCloud