fix(mt): satisfy serial wait loop lint
Use an explicit break-based loop for the Rust serial wait projection so Clippy recognizes that the C wait callback can change the shared job counter. The loop preserves the same lock ownership and condition-wait behavior. Test Plan: - cargo fmt --manifest-path rust/Cargo.toml -- --check - ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
This commit is contained in:
@@ -133,7 +133,10 @@ pub unsafe extern "C" fn ZSTDMT_rust_serialStateWaitForTurn(
|
||||
|
||||
unsafe {
|
||||
lock(state.callback_context);
|
||||
while *state.next_job_id < state.job_id {
|
||||
loop {
|
||||
if *state.next_job_id >= state.job_id {
|
||||
break;
|
||||
}
|
||||
wait(state.callback_context);
|
||||
}
|
||||
c_int::from(*state.next_job_id == state.job_id)
|
||||
|
||||
Reference in New Issue
Block a user