Browse Source

Fixed Windows high CPU utilization bug

pull/1/head
Joseph Henry 8 years ago
parent
commit
42a21d444b
  1. 9
      src/VirtualTap.cpp

9
src/VirtualTap.cpp

@ -47,6 +47,10 @@ typedef unsigned short u16_t;
#include "InetAddress.hpp"
#include "OneService.hpp"
#ifdef _MSC_VER
#include "Synchapi.h"
#endif
int VirtualTap::devno = 0;
VirtualTap::VirtualTap(
@ -208,7 +212,12 @@ void VirtualTap::threadMain()
throw()
{
while (true) {
#ifdef _MSC_VER
Sleep(ZT_PHY_POLL_INTERVAL);
_phy.poll(0);
#else
_phy.poll(ZT_PHY_POLL_INTERVAL);
#endif
Housekeeping();
}
}

Loading…
Cancel
Save