فهرست منبع

no usleep() on Windows

Grant Limberg 6 سال پیش
والد
کامیت
7afcc17024
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      controller/FileDB.cpp

+ 1 - 1
controller/FileDB.cpp

@@ -75,7 +75,7 @@ FileDB::FileDB(EmbeddedNetworkController *const nc,const Identity &myId,const ch
 	_onlineUpdateThread = std::thread([this]() {
 	_onlineUpdateThread = std::thread([this]() {
 		unsigned int cnt = 0;
 		unsigned int cnt = 0;
 		while (this->_running) {
 		while (this->_running) {
-			usleep(250);
+			std::this_thread::sleep_for(std::chrono::microseconds(100));
 			if ((++cnt % 20) == 0) { // 5 seconds
 			if ((++cnt % 20) == 0) { // 5 seconds
 				std::lock_guard<std::mutex> l(this->_online_l);
 				std::lock_guard<std::mutex> l(this->_online_l);
 				if (!this->_running) return;
 				if (!this->_running) return;