[PATCH] D78832: [Support] Fix fragile ThreadPool test

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 17:22:14 PDT 2020


mehdi_amini added inline comments.


================
Comment at: llvm/unittests/Support/ThreadPool.cpp:192
       });
     }
     ASSERT_EQ(true, ThreadsUsed.empty());
----------------
This still leaves the test sensitive to a timing effect, can we make it entirely deterministic?

For example can we increment a counter with a condition variable at the beginning of the lambda before `waitForMainThread()` and wait on the variable in the main thread until it reaches `llvm::get_cpus()` before calling into `    setMainThreadReady();`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78832/new/

https://reviews.llvm.org/D78832





More information about the llvm-commits mailing list