Skip to content

Commit 6bfaf4b

Browse files
Moved shutdown outside of mutex lock
1 parent 46cb245 commit 6bfaf4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/wait_queue_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ bool threaded_test(Q& wq, int num_readers, int num_writers, int slice, const T&
164164
std::this_thread::sleep_for(std::chrono::seconds(1));
165165
std::lock_guard<std::mutex> lk(mut);
166166
if (s.size() == tot) {
167-
wq.request_stop(); // tell the readers it's done
168167
done = true;
169168
}
170169
}
170+
wq.request_stop(); // tell the readers it's done
171171

172172
// join readers; since wait queue is stopped they should all join immediately
173173
for (auto& thr : rd_thrs) {

0 commit comments

Comments
 (0)