fix(mt): keep projected job snapshots under mutex
The Rust-owned frame-progression ring scan consumes ZSTDMT_jobProjection through ZSTDMT_projectJob. That callback previously copied counters under job_mutex but read source and prefix metadata after unlocking. Keep the complete projection in one mutex-protected snapshot, matching the original ZSTDMT_getFrameProgression access pattern without moving descriptor or synchronization ownership out of C. Test Plan: - `rustfmt --check --edition 2021 rust/src/zstdmt_compress.rs` -- passed. - `git diff --check` and `git diff --cached --check` -- passed. - Static inspection only; no cargo, make, native binaries, tests, fuzzers, or heavyweight commands were run.
This commit is contained in:
@@ -664,8 +664,8 @@ pub type ZSTDMT_bufferGetFn = unsafe extern "C" fn(*mut c_void) -> ZstdMtBuffer;
|
||||
|
||||
/// Scalar snapshot of one C-owned job descriptor.
|
||||
///
|
||||
/// The C adapter fills this projection while holding the descriptor mutex.
|
||||
/// Rust owns only the ring-scan decisions below; the descriptor layout,
|
||||
/// The C adapter fills the complete projection while holding the descriptor
|
||||
/// mutex. Rust owns only the ring-scan decisions below; the descriptor layout,
|
||||
/// synchronization objects, and all pointer ownership stay in C.
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
|
||||
Reference in New Issue
Block a user