Skip to content
Snippets Groups Projects
Commit 86c3f345 authored by Greg Clayton's avatar Greg Clayton
Browse files

Fixed a race condition that was sometimes stopping our command line

interpreter from working. The communication read thread could
startup and immediately exit if m_read_thread_enabled was
checked in the thread function before it was set by the
thread that spawns the read thread. Now m_read_thread_enabled is set
to true prior to spawning the read thread to avoid this issue.

Hopefully this will clear up the sporatic failures in our test suite.

llvm-svn: 113947
parent 6757eae4
No related branches found
No related tags found
No related merge requests found
......@@ -211,8 +211,10 @@ 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);
m_read_thread_enabled = m_read_thread != LLDB_INVALID_HOST_THREAD;
if (m_read_thread == LLDB_INVALID_HOST_THREAD)
m_read_thread_enabled = false;
return m_read_thread_enabled;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment