Files
nitro/packages/react-native-nitro-modules/cpp/threading
a4cf95da19 fix: Read _tasks.empty() under _queueMutex in ThreadPool::run() (#1413)
_tasks is a std::queue (backed by std::deque), not thread-safe.
Reading empty() outside the lock while worker threads call pop() and
run() itself calls push() is an unsynchronized access — a data race
caught by TSan. Move the check inside the existing lock scope and call
addThread() after releasing (since addThread() also takes _queueMutex).

Co-authored-by: Miklós Fazekas <boga@MBPM5P.local>
Co-authored-by: Marc Rousavy <me@mrousavy.com>
2026-06-24 16:10:04 +02:00
..