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
Stage 4 fixes: nested pumps drain, timed out Send is abandoned
The Mac and X11 hosts guard their idle drain against reentry, and
CaptureScreenshot's recovery spin runs underneath a queued action - so its
drains were no-ops. With the context installed a genuinely suspending capture
continuation is Posted to that same queue, which nothing would then run: a
silent screenshot failure. The spins now call the new
UiThread.DrainForNestedPump, which skips the guard on purpose and is safe to
nest because InvokePendingActions works from a private copy of the queue. The
guard keeps protecting ordinary reentry (modal dialogs); the two RunEventLoop
call sites are the outermost loop, never nested, so they still drain normally.
A Send that times out now marks its queued work abandoned before it throws, so
the work does not apply late over whatever the caller did instead, and a throw
from work that slipped through goes to UiThread.ReportUnhandledException rather
than a field no caller will ever read. Post and Send reject a null callback at
the call site, per the BCL contract.
Comments corrected where they now asserted the opposite of reality, plus a note
on Post latency: a resumption costs up to one idle tick, so an N deep chain of
suspending awaits can cost N.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments