Skip to content

Commit 5e0887b

Browse files
committed
consumer thread sleeps until producer has added first item
1 parent 79b90fe commit 5e0887b

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
@@ -71,6 +71,10 @@ TEST_F(Global_Concurrency_RingQueueTests, FixedSizeQueue)
7171
if (successCount == 10) {
7272
break;
7373
}
74+
if (successCount == 0) {
75+
// simple wait until the producer has added its first item
76+
std::this_thread::sleep_for(std::chrono::milliseconds(1));
77+
}
7478
}
7579

7680
EXPECT_EQ(successCount, 10);

0 commit comments

Comments
 (0)