mirror of
https://github.com/XRPLF/rippled.git
synced 2026-03-01 02:02:34 +00:00
Change postCoroTask from async post() to synchronous resume() for the initial coroutine dispatch. The async approach created a timing-dependent race during Env destruction where the coroutine frame's shared_ptr reference cycle could be broken in an indeterminate order, causing the debug-only finished_ assertion to fire non-deterministically on GCC-12 and GCC-15 debug builds. The synchronous resume runs the coroutine body to its first suspension point (co_await) or completion (co_return) on the caller's thread, ensuring the coroutine state is determinate before postCoroTask returns. Subsequent resumes still happen on worker threads via post(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>