MCPcopy Create free account
hub / github.com/Icinga/icinga2 / WaitForData

Method WaitForData

lib/base/stream.cpp:43–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool Stream::WaitForData()
44{
45 if (!SupportsWaiting())
46 BOOST_THROW_EXCEPTION(std::runtime_error("Stream does not support waiting."));
47
48 std::unique_lock<std::mutex> lock(m_Mutex);
49
50 while (!IsDataAvailable() && !IsEof())
51 m_CV.wait(lock);
52
53 return IsDataAvailable() || IsEof();
54}
55
56bool Stream::WaitForData(int timeout)
57{

Callers 1

FillFromStreamMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected