X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fplatform%2Futil%2Fbuffer.h;h=8777661df1c4e6942f937905126b868c2d2cce1f;hb=a75e3a5a63546d6f7e670bc2a7a1931887a5d2a0;hp=56ffd6450225384359ce1cb4a159d784d3fb624e;hpb=fa4b80dfb92e15862041715cd3f1cbbf3f244f1e;p=deb_libcec.git diff --git a/src/lib/platform/util/buffer.h b/src/lib/platform/util/buffer.h index 56ffd64..8777661 100644 --- a/src/lib/platform/util/buffer.h +++ b/src/lib/platform/util/buffer.h @@ -90,6 +90,18 @@ namespace PLATFORM return bReturn; } + bool Peek(_BType &entry) + { + bool bReturn(false); + CLockObject lock(m_mutex); + if (!m_buffer.empty()) + { + entry = m_buffer.front(); + bReturn = true; + } + return bReturn; + } + private: size_t m_maxSize; std::queue<_BType> m_buffer;