Skip to content
Commit a08cfb12 authored by Stephen Wilson's avatar Stephen Wilson
Browse files

Do not pass an invalid thread to Thread{Cancel,Join}.

A race condition exists between StopReadThread and the reader thread proper.
When StopReadThread sets m_read_thread_enabled to false the reader thread can
terminate and set m_read_thread to LLDB_INVALID_HOST_THREAD on exit.  Thus calls
to ThreadCancel or ThreadJoin in StopReadThread can be passed an invalid handle.

This patch removes the race by using m_read_thread_enabled as the flag thru
which the reader thread can notify the parent thread of early/abnormal
termination.

llvm-svn: 123309
parent c2204398
Loading
Loading
Loading
Loading
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