zstdmt: fixed minor race condition
no real consequence, but pollute tsan tests : job->dstBuff is being modified inside worker, while main thread might read it accidentally because it copies whole job. But since it doesn't used dstBuff, there is no real consequence. Other potential solution : only copy useful data, instead of whole job
This commit is contained in:
parent
ebd955e26a
commit
de5e38a7a6
@ -344,7 +344,9 @@ void ZSTDMT_compressChunk(void* jobDescription)
|
|||||||
job->cSize = ERROR(memory_allocation);
|
job->cSize = ERROR(memory_allocation);
|
||||||
goto _endJob;
|
goto _endJob;
|
||||||
}
|
}
|
||||||
|
ZSTD_PTHREAD_MUTEX_LOCK(job->jobCompleted_mutex); /* note : it's a mtctx mutex */
|
||||||
job->dstBuff = dstBuff;
|
job->dstBuff = dstBuff;
|
||||||
|
ZSTD_pthread_mutex_unlock(job->jobCompleted_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* init */
|
/* init */
|
||||||
|
Loading…
Reference in New Issue
Block a user