Skip to content

Commit

Permalink
test_ring_buffer: Use yield instead of sleep_for(10us).
Browse files Browse the repository at this point in the history
See issue #567 for details.
  • Loading branch information
kinetiknz committed Jan 21, 2020
1 parent 3b6cc57 commit 8de9913
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_ring_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void test_ring_multi(lock_free_audio_ring_buffer<T>& buf, int channels, int capa
sequence_generator<T> gen(channels);

while(iterations--) {
std::this_thread::sleep_for(std::chrono::microseconds(10));
std::this_thread::yield();
gen.get(in_buffer.get(), block_size);
int rv = buf.enqueue(in_buffer.get(), block_size);
ASSERT_TRUE(rv <= block_size);
Expand All @@ -115,7 +115,7 @@ void test_ring_multi(lock_free_audio_ring_buffer<T>& buf, int channels, int capa
int remaining = 1002;

while(remaining--) {
std::this_thread::sleep_for(std::chrono::microseconds(10));
std::this_thread::yield();
int rv = buf.dequeue(out_buffer.get(), block_size);
ASSERT_TRUE(rv <= block_size);
checker.check(out_buffer.get(), rv);
Expand Down

0 comments on commit 8de9913

Please sign in to comment.