Skip to content

Commit

Permalink
Replace usleep with sleep
Browse files Browse the repository at this point in the history
usleep was deprecated with POSIX 2008 and optionally unavailable with
uClibc-ng.
  • Loading branch information
neheb committed Aug 23, 2019
1 parent 7659cd0 commit 162f322
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/thread_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit 162f322

Please sign in to comment.