lichao
2021-04-26 1b167ec5ad101ac44451381e26cc73ab5d67d2a1
src/sendq.cpp
@@ -16,10 +16,12 @@
 * =====================================================================================
 */
#include "sendq.h"
#include "shm_queue.h"
#include "shm_msg_queue.h"
#include <chrono>
int SendQ::DoSend1Remote(bhome_shm::ShmMsgQueue &mq, const Remote remote, Array &arr)
using namespace bhome_shm;
int SendQ::DoSend1Remote(ShmMsgQueue &mq, const Remote remote, Array &arr)
{
   auto FirstNotExpired = [](Array &l) {
      auto Less = [](const TimedMsg &msg, const TimePoint &tp) { return msg.expire() < tp; };
@@ -65,7 +67,7 @@
   return nprocessed;
}
int SendQ::DoSend1Remote(bhome_shm::ShmMsgQueue &mq, const Remote remote, ArrayList &al)
int SendQ::DoSend1Remote(ShmMsgQueue &mq, const Remote remote, ArrayList &al)
{
   int nsend = 0;
   auto AllSent = [&](Array &arr) {
@@ -76,7 +78,7 @@
   return nsend;
}
bool SendQ::TrySend(bhome_shm::ShmMsgQueue &mq)
bool SendQ::TrySend(ShmMsgQueue &mq)
{
   std::unique_lock<std::mutex> lock(mutex_out_);
   size_t nsend = 0;