From 162f322d6b2e624d3988df8c80a218c8616e45eb Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 23 Aug 2019 13:35:28 -0700 Subject: [PATCH] Replace usleep with sleep usleep was deprecated with POSIX 2008 and optionally unavailable with uClibc-ng. --- src/thread_base.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread_base.cc b/src/thread_base.cc index 081791d4c..81f7ec635 100644 --- a/src/thread_base.cc +++ b/src/thread_base.cc @@ -66,7 +66,7 @@ class lt_cacheline_aligned thread_queue_hack { thread_queue_hack() { std::memset(this, 0, sizeof(thread_queue_hack)); } - void lock() { while (!__sync_bool_compare_and_swap(&m_lock, 0, 1)) usleep(0); } + void lock() { while (!__sync_bool_compare_and_swap(&m_lock, 0, 1)) sleep(0); } void unlock() { __sync_bool_compare_and_swap(&m_lock, 1, 0); } iterator begin() { return m_queue; }