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:
@@ -1703,12 +1703,12 @@ static void ZSTDMT_projectJob(void* opaque, unsigned jobID,
|
||||
ZSTD_pthread_mutex_lock(&job->job_mutex);
|
||||
projection->consumed = job->consumed;
|
||||
projection->cSize = job->cSize;
|
||||
projection->dstFlushed = job->dstFlushed;
|
||||
ZSTD_pthread_mutex_unlock(&job->job_mutex);
|
||||
projection->srcStart = job->src.start;
|
||||
projection->srcSize = job->src.size;
|
||||
projection->prefixStart = job->prefix.start;
|
||||
projection->prefixSize = job->prefix.size;
|
||||
projection->dstFlushed = job->dstFlushed;
|
||||
ZSTD_pthread_mutex_unlock(&job->job_mutex);
|
||||
}
|
||||
|
||||
static void ZSTDMT_freeJobsTable(ZSTDMT_jobDescription* jobTable, U32 nbJobs, ZSTD_customMem cMem)
|
||||
|
||||
Reference in New Issue
Block a user