[hb-shape-threads] Fix tsan race

This commit is contained in:
Behdad Esfahbod 2022-05-27 17:05:23 -06:00
parent 33c990f0a9
commit e3d5a117a3
1 changed files with 4 additions and 1 deletions

View File

@ -161,7 +161,10 @@ static void test_backend (backend_t backend,
for (unsigned i = 0; i < num_threads; i++) for (unsigned i = 0; i < num_threads; i++)
threads.push_back (std::thread (shape, variable, backend, test_input)); threads.push_back (std::thread (shape, variable, backend, test_input));
ready = true; {
std::unique_lock<std::mutex> lk (cv_m);
ready = true;
}
cv.notify_all(); cv.notify_all();
for (unsigned i = 0; i < num_threads; i++) for (unsigned i = 0; i < num_threads; i++)