acquireStateLock was allocating a fresh SharedArrayBuffer on every retry iteration via Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), ...). The buffer is never mutated and never escapes, so hoisting it before the loop is a provably-equivalent transformation — Atomics.wait always sees value 0 whether the buffer is fresh or reused. Fixes #316 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8.6 KiB
8.6 KiB