mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-02 12:56:05 +00:00
A cleared kqueue watch read the watched queue's triggered count and its activation counter under two separate locks, so an activation between the reads was marked seen without making the watch active, and the wakeup was lost. SnapshotTriggered now returns both under one lock. Every poll of an active watch also rechecks the count, as kqueue_scan reruns filt_kqueue: it drops when the watched queue empties and reports the current count. EV_ADD and EV_ENABLE of an existing watch re-arm it. A separate guest_kqueue_cleared_race test triggers the watched queue from another thread while the watching queue waits.