hle(host_posix): implement WaitOnAddress and WakeByAddress* #560
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!560
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-556"
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?
@Sheffy007 on GitHub · 2026-11-28 03:52 UTC · original
Sheffy007:feat/host-posix-wait-on-address→main· +250 −4 · 1 files · 1 commits · merged 2026-11-28 03:59 UTCSummary
WaitOnAddress,WakeByAddressSingle, andWakeByAddressAllincrates/victory-hle/src/host_posix/sync.rsand expose them insync::lookup.SeqCstatomic loads or unaligned reads),ERROR_INVALID_PARAMETERon null pointers or invalid sizes, andERROR_TIMEOUTon zero/expired deadlines.wait_on_address_handles_sizes_timeouts_and_isolated_wakes.Verification
cargo xtask policycargo test --locked --target x86_64-apple-darwin -p victory-hle --lib -- host_posix::sync::tests --test-threads=1(4 passed)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warningscargo clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-gnullvm -- -D warningsCloses #559
cc @Olima34
Implement `WaitOnAddress`, `WakeByAddressSingle`, and `WakeByAddressAll` in `host_posix::sync` and register them in `sync::lookup` so `api-ms-win-core-synch-l1-2-0.dll`, `kernelbase.dll`, `kernel32.dll`, and `GetProcAddress` resolve them on macOS. Uses striped FIFO waiter queues keyed by exact target address on top of `victory_platform::sync::{wait_on_address, wake_one}`, supporting 1-, 2-, 4-, and 8-byte comparisons (aligned `SeqCst` atomic loads and unaligned reads), `ERROR_INVALID_PARAMETER` validation, `ERROR_TIMEOUT` deadlines, and address-isolated single and broadcast wakes. Closes #555@Olima34 on GitHub · 2026-11-28 03:59 UTC · original · approved these changes
Check report (helping the maintainer clear the queue):
checkandmacos-scriptsgreen on14ec9b75.WaitOnAddresscompares under the address's stripe lock and parks on a per-waiter word, andWakeByAddress*removes and flags waiters under the same lock. So a wake between the comparison and the park can't be lost, and waiters on different addresses that share a stripe don't steal each other's wakes. 1/2/4/8-byte compares (atomic when aligned),ERROR_INVALID_PARAMETERfor null or bad sizes, andERROR_TIMEOUTon a zero or expired timeout follow Windows. The exports resolve fromapi-ms-win-core-synch-l1-2-0,kernelbaseandkernel32. The test covers sizes, timeouts and wakes isolated per address.9c001aa7) + #543 + this PR:victory-hletests pass on x86_64-apple-darwin (338 + 17), Windows clippy (-D warnings) clean,cargo xtask policyok.Thanks @Sheffy007!