mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1042] frame_pacer: wake blocked waiters on set_uncapped and guard shutdown entry #1079
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1079
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1042
Author: @madhyn
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/frame-pacer-shutdown-wakeup📝 Commits (4)
7d6c7f3frame_pacer: notify waiters on set_uncapped and hold lock across shutdown notifye26f6c1frame_pacer_test: verify late waiter during ~FramePacer shutdown returns invalid_state with zero clock reads4917377frame_pacer_test: release HoldingClock before asserting late-waiter results29736beframe_pacer: release waiter registration via RAII on clock exception📊 Changes
2 files changed (+152 additions, -9 deletions)
View changed files
📝
runtime/src/frame_pacer.h(+19 -9)📝
runtime/test/frame_pacer_test.cpp(+133 -0)📄 Description
What and why
Addresses the
runtime/src/frame_pacer.hwakeup/shutdown races reported in #14 by @akimfomin:set_uncapped):set_uncapped(bool)updateduncapped_undermutex_without notifyingcv_, so a waiter already blocked on the vblank grid missed the mode switch. It now callscv_.notify_all()after releasingmutex_.~FramePacer/wait_frame_event):~FramePacer()now holdsmutex_across settingshutdown_ = true, callingcv_.notify_all(), and enteringcv_.wait(lock, ...)(eliminating the unlocked window betweenshutdown_ = trueandcv_.wait), andwait_frame_eventreturnspacer_hr::invalid_stateimmediately ifshutdown_is already set before incrementingwaiters_.Testing
runtime/test/frame_pacer_test.cppcovering:FramePacerwith multiple blocked waiters (origin,vblank,flip).set_uncapped(true)while a waiter is blocked onManualFrameClock.ctest -R frame_pacer --output-on-failure(Wine 11.22,clang-cl+xwin): 1/1 passed (6.69 s).AI-assisted: yes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.