[PATCH] D133713: [Support] Introduce ThreadSafeAllocator
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 13:47:44 PST 2023
dblaikie added inline comments.
================
Comment at: llvm/unittests/Support/ThreadSafeAllocatorTest.cpp:27
+ BytesAllocated += Size;
+ usleep(5); // add some delay.
+ AllocFlag.clear();
----------------
timers like this risk flaky failures if the system is under load such that the delay is inadequate to induce contention - they also make tests unnecessarily slow. Could you do this with locking/flags instead, ensuring that events occur as required?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133713/new/
https://reviews.llvm.org/D133713
More information about the llvm-commits
mailing list