mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 22:19:57 -04:00
The worker checked that the want was still the one it had read and then stored active = 1, two steps on two atomics. A rtss_limit_want between them (frame generation or low latency switched on, a movie, a new limit) stored the new want and active = 0, and the worker's store then set active back to 1: frame_step_cap_ns returned 0 for the kept-out want until the next poll, up to 500 ms in which nothing limited the game. The worker now stores the want RTSS holds the game to (active_for, or RTSS_UNSET for none), and rtss_limit_active is true only while it equals the newest want, so a change of the want stops matching at once and rtss_limit_want no longer clears anything. The frame count check against the limit keeps its test that the want has not changed. tests/rtss_worker_check.c gains active_race: the worker polls without pause while the want switches 400000 times between 60 fps and frame generation, and after each switch to frame generation rtss_limit_active must read 0 until the worker has seen it. Before the change 128440 switches read 1; after it none do. The other scenarios and a compile of rtss_limit.c with -Wall pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 KiB
20 KiB