lichao
2021-05-20 6b96ee857e366af317ab9dc1b6b4f9c22576e83b
src/shm_socket.cpp
@@ -20,7 +20,9 @@
#include "bh_util.h"
#include "defs.h"
#include "msg.h"
#include "sleeper.h"
#include <chrono>
using namespace std::chrono;
using namespace std::chrono_literals;
@@ -90,11 +92,15 @@
      };
      try {
         thread_local FibUSleeper sleeper(1000 * 10);
         bool more_to_send = DoSend();
         bool more_to_recv = DoRecv();
         if (onIdle) { onIdle(*this); }
         if (!more_to_send && !more_to_recv) {
            robust::QuickSleep();
            sleeper.Sleep();
         } else {
            sleeper.Reset();
         }
      } catch (...) {
      }