mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:25:53 +01:00
[PR #680] queue_holds: scope in_pump per instance with RAII and allow re-entrant detach/cancel_after (RT-QUEUE-HOLDS-REENTRY) #720
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#720
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/680
Author: @hamdog0203
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/rt-queue-holds-reentry📝 Commits (1)
d705fc9queue_holds: scope in_pump per instance with RAII and allow re-entrant detach/cancel_after (RT-QUEUE-HOLDS-REENTRY)📊 Changes
3 files changed (+371 additions, -28 deletions)
View changed files
📝
runtime/CMakeLists.txt(+3 -0)📝
runtime/src/queue_holds.h(+86 -28)➕
runtime/test/queue_holds_test.cpp(+282 -0)📄 Description
Claimed in the coordination issue as: RT-QUEUE-HOLDS-REENTRY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7130376907)
AI-assisted: yes
No game files touched or included.
Summary
Fixes three re-entrancy and lifetime bugs in
runtime/src/queue_holds.hand adds standalone unit tests inruntime/test/queue_holds_test.cpp:in_pump()tracking: replaces the single globalthread_local boolwith a per-QueueHolds*thread-local stack managed by an RAIIPumpGuard. SiblingQueueHoldsinstances running on the same thread no longer suppress each other'spump_ready()/remove_fence()calls, and exceptions thrown from callbacks no longer leavein_pump()stucktrue.detach()andcancel_after(): when called from within an activepump_ready()/remove_fence()pass on the same thread,detach()andcancel_after()updateholders_/barriers_undermutex_and setdirty_without attempting to re-acquirepump_mutex_(preventing a self-deadlock), while external threads continue waiting onpump_mutex_.snapshot()inpump_ready(),run_barriers(), andremove_fence()re-checkis_attached(holder)before invoking callbacks on a holder so a sibling holder detached mid-pass is never called after teardown.Verification
14.44.35207+ Windows SDK10.0.26100.0(scripts\build_runtime.ps1):239/239affected targets built cleanly with zero new warnings.ctest --test-dir runtime\build --output-on-failure -V -R "^(queue_holds|d3d12_fence_timing|vk_presenter_sync|vk_queue_query_sync|vk_overlapping_occlusion|vk_queue_constructor_oom)$"on Windows 11 + NVIDIA GeForce RTX 4060 (driver621.35): 6/6 passed (100%), includingqueue_holds tests passed (5/5).main(runtime/src/queue_holds.h):queue_holdsfailed immediately (sibling_instance failed, exit code8).python -I scripts/check_no_game_data.py runtime/src/queue_holds.h runtime/test/queue_holds_test.cpp runtime/CMakeLists.txt-> exit0;git diff --checkclean.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.