Add Pipe::WriteWithTimeout method
authorPavel Labath <labath@google.com>
Tue, 21 Jul 2015 09:23:34 +0000 (09:23 +0000)
committerPavel Labath <labath@google.com>
Tue, 21 Jul 2015 09:23:34 +0000 (09:23 +0000)
commit9f0701f8cafd50bbe9b36795c4331f3d82ce109a
tree017bcb9a0539c0118a026502c3da864e3de4407d
parentd818e38ff979c21577abada60057c83946852aeb
Add Pipe::WriteWithTimeout method

Summary:
This commit adds a WriteWithTimeout method to time Pipe class, analogous to the existing
ReadWithTimeout(). It also changes the meaning of passing zero as a timeout value. Previously,
zero was used as an infinite timeout value. Now, the meaning of zero timeout to return the data
avaiable without sleeping (basically, a non-blocking operation). This makes the behaviour of Pipe
consistent with the Communication/Connection classes. For blocking operatios with infinite
timeout, I introduce a special constant for this purpose.

Reviewers: ovyalov, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11358

llvm-svn: 242764
lldb/include/lldb/Host/PipeBase.h
lldb/include/lldb/Host/posix/PipePosix.h
lldb/include/lldb/Host/windows/PipeWindows.h
lldb/source/Host/common/PipeBase.cpp
lldb/source/Host/posix/PipePosix.cpp
lldb/source/Host/windows/PipeWindows.cpp