You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tsan): eliminate data race in WalMmapWriter move constructor
The open() factory started the background thread with a pointer to a
local WalMmapWriter, then returned it by value into expected<>. The
move constructor raced with the bg thread: the thread accessed members
of the local while the move was transferring ownership.
Fix: defer bg thread start via bg_deferred_ flag. open() sets the
flag instead of spawning the thread. The move constructor (which
constructs the final destination object) starts the thread with a
stable `this` pointer. Both move-ctor and move-assign handle the
deferred flag and reset it after starting the thread.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments