_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>
* chore: Add `NON_NULL` and `NULLABLE` annotations on all pointers
* feat: Add `CONTIGUOUS_MEMORY` and `NON_NULL`
* Create `InstanceMethod<...>`
* chore: Use `InstanceMethod<...>`
* feat: Create `Promise.hpp`
* feat: Add `JSIConverter+Exception`
* feat: Base for `Promise` and `Exception`
* fix: Implement Exception conversion
* Implement `Promise::awaitFuture`
* Revive `+Future`
* fix: Speed up creating `ThreadPool`
* fix: Make `+Future` also just use `+Promise` impl
* fix: Thread pool has 10 threads now.
* feat: Allow `ThreadPool` to grow dynamically
* chore: Format C++