1 --- a/src/data/hash_queue.cc
2 +++ b/src/data/hash_queue.cc
5 #define __STDC_FORMAT_MACROS
10 #include <rak/functional.h>
13 #include "torrent/exceptions.h"
14 #include "torrent/data/download_data.h"
15 @@ -137,7 +138,7 @@ HashQueue::remove(HashQueueNode::id_type id) {
17 while ((done_itr = m_done_chunks.find(hash_chunk)) == m_done_chunks.end()) {
18 pthread_mutex_unlock(&m_done_chunks_lock);
20 + std::this_thread::sleep_for(std::chrono::microseconds(100));
21 pthread_mutex_lock(&m_done_chunks_lock);
24 --- a/src/torrent/utils/thread_base.cc
25 +++ b/src/torrent/utils/thread_base.cc
35 #include "exceptions.h"
37 @@ -97,7 +98,7 @@ thread_base::stop_thread_wait() {
38 release_global_lock();
40 while (!is_inactive()) {
42 + std::this_thread::sleep_for(std::chrono::milliseconds(1));
45 acquire_global_lock();
46 @@ -161,7 +162,7 @@ thread_base::event_loop(thread_base* thread) {
49 // Add the sleep call when testing interrupts, etc.
51 + // std::this_thread::sleep_for(std::chrono::microseconds(50));