diff options
author | Tim Northover <tnorthover@apple.com> | 2013-06-27 21:19:30 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-06-27 21:19:30 +0000 |
commit | 0614fcd0e39d9ec424b32de2039b8e2fc6937d4b (patch) | |
tree | 01ee46bef9fa9bef7b86bec2b503e994e393e68f /lldb/source/Core/Communication.cpp | |
parent | 28e84fc53eb8e0c746ee9235781b4652d3a3ea6d (diff) | |
download | bcm5719-llvm-0614fcd0e39d9ec424b32de2039b8e2fc6937d4b.tar.gz bcm5719-llvm-0614fcd0e39d9ec424b32de2039b8e2fc6937d4b.zip |
Prevent race in when stopping a "read thread"
Both StopReadThread and the thread being stopped set the thread id to
0 after m_read_thread_enabled was set to false. If the thread being
stopped got there first then StopReadThread called pthread_join on an
invalid thread number. This is not a Good Thing,
Should fix a fairly regular segfault when quitting on Linux.
llvm-svn: 185107
Diffstat (limited to 'lldb/source/Core/Communication.cpp')
-rw-r--r-- | lldb/source/Core/Communication.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index 6e1c545f066..7f40e652020 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -390,8 +390,6 @@ Communication::ReadThread (void *p) // Let clients know that this thread is exiting comm->BroadcastEvent (eBroadcastBitReadThreadDidExit); - comm->m_read_thread_enabled = false; - comm->m_read_thread = LLDB_INVALID_HOST_THREAD; return NULL; } |