cec: refactor USB adapter communication. less locks, shorter locks, added documentati...
[deb_libcec.git] / src / lib / platform / util / buffer.h
index 56ffd6450225384359ce1cb4a159d784d3fb624e..8777661df1c4e6942f937905126b868c2d2cce1f 100644 (file)
@@ -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;