Skip to content

Commit e791886

Browse files
committed
Clarified example code (issue #94)
1 parent 08c295d commit e791886

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,18 @@ BlockingReaderWriterQueue<int> q;
6464
6565
std::thread reader([&]() {
6666
int item;
67+
#if 1
6768
for (int i = 0; i != 100; ++i) {
6869
// Fully-blocking:
6970
q.wait_dequeue(item);
70-
71+
}
72+
#else
73+
for (int i = 0; i != 100; ) {
7174
// Blocking with timeout
7275
if (q.wait_dequeue_timed(item, std::chrono::milliseconds(5)))
7376
++i;
7477
}
78+
#endif
7579
});
7680
std::thread writer([&]() {
7781
for (int i = 0; i != 100; ++i) {

0 commit comments

Comments
 (0)