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
This commit is contained in:
Tim Northover 2013-06-27 21:19:30 +00:00
parent 28e84fc53e
commit 0614fcd0e3
1 changed files with 0 additions and 2 deletions

View File

@ -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;
}