diff options
author | Matthew Gregan <[email protected]> | 2020-01-21 23:38:06 +1300 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2020-01-21 11:38:06 +0100 |
commit | be3005530f9409e9aba91ef246005c30ba0f79e1 (patch) | |
tree | bbd62c5c9416a003e18344ca982317cb747e199d /test/test_ring_buffer.cpp | |
parent | 3b6cc572b370aebe678e0fd804d34f53341959a3 (diff) | |
download | cubeb-be3005530f9409e9aba91ef246005c30ba0f79e1.tar.gz cubeb-be3005530f9409e9aba91ef246005c30ba0f79e1.zip |
test_ring_buffer: Use `yield` instead of `sleep_for(10us)`. (#569)
See issue #567 for details.
Diffstat (limited to 'test/test_ring_buffer.cpp')
-rw-r--r-- | test/test_ring_buffer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_ring_buffer.cpp b/test/test_ring_buffer.cpp index 7c011ba..261cd79 100644 --- a/test/test_ring_buffer.cpp +++ b/test/test_ring_buffer.cpp @@ -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); @@ -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); |