lichao
2021-04-06 bb9a7e348892eb5c4fccb063380aa6fcd9612b71
src/shm_queue.h
@@ -134,22 +134,26 @@
   bool Recv(BHMsg &msg, const int timeout_ms);
   bool Recv(MsgI &msg, const int timeout_ms) { return Read(msg, timeout_ms); }
   static bool Send(SharedMemory &shm, const MQId &remote_id, const MsgI &msg, const int timeout_ms, OnSend const &onsend);
   static bool Send(SharedMemory &shm, const MQId &remote_id, const MsgI &msg, const int timeout_ms)
   static bool Send(SharedMemory &shm, const MQId &remote_id, const MsgI &msg, const int timeout_ms);
   template <class... Extra>
   bool Send(const MQId &remote_id, const MsgI &msg, const int timeout_ms, Extra const &...extra)
   {
      return Send(shm, remote_id, msg, timeout_ms, []() {});
      return Send(shm(), remote_id, msg, timeout_ms, extra...);
   }
   bool Send(const MQId &remote_id, const BHMsg &msg, const int timeout_ms, OnSend const &onsend);
   bool Send(const MQId &remote_id, const BHMsg &msg, const int timeout_ms)
   template <class... Extra>
   bool Send(const MQId &remote_id, const BHMsg &data, const int timeout_ms, Extra const &...extra)
   {
      return Send(remote_id, msg, timeout_ms, []() {});
   }
   bool Send(const MQId &remote_id, const MsgI &msg, const int timeout_ms, OnSend const &onsend)
   {
      return Send(shm(), remote_id, msg, timeout_ms, onsend);
   }
   bool Send(const MQId &remote_id, const MsgI &msg, const int timeout_ms)
   {
      return Send(shm(), remote_id, msg, timeout_ms);
      MsgI msg;
      if (msg.Make(shm(), data)) {
         if (Send(shm(), remote_id, msg, timeout_ms, extra...)) {
            return true;
         } else {
            msg.Release(shm());
         }
      }
      return false;
   }
   size_t Pending() const { return data()->size(); }
};