Skip to content

Commit aed6961

Browse files
committed
consumer thread sleeps until producer has added first item
1 parent 108b0df commit aed6961

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

framework/global/tests/ringqueue_tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ TEST_F(Global_Concurrency_RingQueueTests, FixedSizeQueue)
7070
if (successCount == 10) {
7171
break;
7272
}
73+
if (successCount == 0) {
74+
// simple wait until the producer has added its first item
75+
std::this_thread::sleep_for(std::chrono::milliseconds(1));
76+
}
7377
}
7478

7579
EXPECT_EQ(successCount, 10);

0 commit comments

Comments
 (0)