hle(host_posix): implement WaitOnAddress and WakeByAddress* #556
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-28T03:52:40Z.
Summary
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 #555
cc @Olima34
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T03:59:29Z.
Review: APPROVED
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) + #539 + this PR:victory-hletests pass on x86_64-apple-darwin (338 + 17), Windows clippy (-D warnings) clean,cargo xtask policyok.Thanks @Sheffy007!