Skip to content

Commit

Permalink
Don't use AtomicFreeList to squash TSAN complains
Browse files Browse the repository at this point in the history
The previous fix attempt didn't work on some test. There are no known
bugs with AtomicFreeList other than tripping TSAN, and it's unclear
that TSAN isn't at fault.

However, switching to using a mutex works fine and doesn't appear to
be slower (it's actually faster with synthetic benchmarks on macOS)

BUGS=[377369108]
  • Loading branch information
pixelflinger committed Nov 14, 2024
1 parent d075a87 commit 555e1d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/utils/include/utils/JobSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class JobSystem {
Condition mWaiterCondition;

std::atomic<int32_t> mActiveJobs = { 0 };
utils::Arena<utils::ThreadSafeObjectPoolAllocator<Job>, LockingPolicy::NoLock> mJobPool;
utils::Arena<utils::ObjectPoolAllocator<Job>, LockingPolicy::Mutex> mJobPool;

template <typename T>
using aligned_vector = std::vector<T, utils::STLAlignedAllocator<T>>;
Expand Down

0 comments on commit 555e1d1

Please sign in to comment.