[Lldb-commits] [PATCH] D139484: [lldb/test] Fix data racing issue in TestStackCoreScriptedProcess
Alex Langford via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 7 10:58:52 PST 2022
bulbazord added inline comments.
================
Comment at: lldb/test/API/functionalities/scripted_process/main.cpp:18
+ std::unique_lock<std::mutex> lock(mutex);
+ cv.notify_one();
+ n = foo(n);
----------------
Why do you need this initial notification?
================
Comment at: lldb/test/API/functionalities/scripted_process/main.cpp:25-27
+ while (baz(n, mutex, cv, done) != 42) {
+ ;
+ }
----------------
Why does this need to be in a while loop? The condition_variable's `wait` function should guarantee that `baz` only ever returns `42`, no? Unless I'm missing something.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139484/new/
https://reviews.llvm.org/D139484
More information about the lldb-commits
mailing list