summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-09-03 09:30:17 +0000
committerPavel Labath <labath@google.com>2015-09-03 09:30:17 +0000
commita9a43373e17ca0eb1cb667c9be97da577cc70b99 (patch)
tree4330a24e1dbb1abc9cb5273b06747f4a781bad30 /clang/lib/Driver/Tools.cpp
parent61efbc32a6b15baa856a89c62de5cb2100a9f866 (diff)
downloadbcm5719-llvm-a9a43373e17ca0eb1cb667c9be97da577cc70b99.tar.gz
bcm5719-llvm-a9a43373e17ca0eb1cb667c9be97da577cc70b99.zip
Fix rare failure in TestProcessIO
Summary: There was a race condition in Process class, where we would not wait for process stdout to propagate fully before we would shut down the connection (repro case: slow down the stdio thread by placing a sleep right at the end of the while loop in Communication::ReadThread). The Process class already tried to solve this problem by synchronizing with the read thread in Process::ShouldBroadcastEvent, but unfortunately the connection got closed before that in Process::SetExitStatus. I solve this issue by delaying the connection shutdown until we get a chance to process the event and synchronize. Alternatively, I could have moved the synchronization point to an earlier point in SetExitStatus, but it seems safer to delay the shutdown until other things get a chance to notice the process has exited. Reviewers: clayborg, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12558 llvm-svn: 246753
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud