<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- a/src/data/hash_queue.cc
+++ b/src/data/hash_queue.cc
@@ -38,9 +38,10 @@
 
 #define __STDC_FORMAT_MACROS
 
+#include &lt;chrono&gt;
+#include &lt;thread&gt;
 #include &lt;functional&gt;
 #include &lt;rak/functional.h&gt;
-#include &lt;unistd.h&gt;
 
 #include "torrent/exceptions.h"
 #include "torrent/data/download_data.h"
@@ -137,7 +138,7 @@ HashQueue::remove(HashQueueNode::id_type
 
       while ((done_itr = m_done_chunks.find(hash_chunk)) == m_done_chunks.end()) {
         pthread_mutex_unlock(&amp;m_done_chunks_lock);
-        usleep(100);
+        std::this_thread::sleep_for(std::chrono::microseconds(100));
         pthread_mutex_lock(&amp;m_done_chunks_lock);
       }
 
--- a/src/torrent/utils/thread_base.cc
+++ b/src/torrent/utils/thread_base.cc
@@ -37,8 +37,9 @@
 #include "config.h"
 
 #include &lt;cstring&gt;
+#include &lt;chrono&gt;
+#include &lt;thread&gt;
 #include &lt;signal.h&gt;
-#include &lt;unistd.h&gt;
 
 #include "exceptions.h"
 #include "poll.h"
@@ -97,7 +98,7 @@ thread_base::stop_thread_wait() {
   release_global_lock();
 
   while (!is_inactive()) {
-    usleep(1000);
+    std::this_thread::sleep_for(std::chrono::milliseconds(1));
   }  
 
   acquire_global_lock();
@@ -161,7 +162,7 @@ thread_base::event_loop(thread_base* thr
       }
 
       // Add the sleep call when testing interrupts, etc.
-      // usleep(50);
+      // std::this_thread::sleep_for(std::chrono::microseconds(50));
 
       int poll_flags = 0;
 
</pre></body></html>