lichao
2021-05-10 77a6c3512a44dfe6540dde71946e6484fe4f173f
src/shm_queue.h
@@ -54,6 +54,7 @@
   }
   bool TryRead(D &d)
   {
      // bhome_shm::Guard lock(mutex_);
      if (!queue_.empty()) {
         d = queue_.front();
         queue_.pop_front();
@@ -64,6 +65,7 @@
   }
   bool TryWrite(const D &d)
   {
      // bhome_shm::Guard lock(mutex_);
      if (!queue_.full()) {
         queue_.push_back(d);
         return true;
@@ -74,12 +76,16 @@
private:
   Circular<D> queue_;
   bhome_shm::Mutex mutex_;
};
template <int Power = 4>
class SharedQ63
{
public:
   template <class... T>
   explicit SharedQ63(T &&...t) {} // easy testing
   typedef int64_t Data;
   bool Read(Data &d, const int timeout_ms)
   {