mirror of
https://github.com/facebook/zstd.git
synced 2025-10-28 00:03:48 -04:00
fixed some issues with segfaults
This commit is contained in:
parent
95ea54b4cf
commit
cd50382c03
Binary file not shown.
@ -64,6 +64,15 @@ static adaptCCtx* createCCtx(unsigned numJobs, const char* const outFilename)
|
|||||||
pthread_cond_init(&ctx->allJobsCompleted_cond, NULL);
|
pthread_cond_init(&ctx->allJobsCompleted_cond, NULL);
|
||||||
ctx->numJobs = numJobs;
|
ctx->numJobs = numJobs;
|
||||||
ctx->jobs = calloc(1, numJobs*sizeof(jobDescription));
|
ctx->jobs = calloc(1, numJobs*sizeof(jobDescription));
|
||||||
|
{
|
||||||
|
unsigned u;
|
||||||
|
for (u=0; u<numJobs; u++) {
|
||||||
|
ctx->jobs[u].jobCompleted_mutex = &ctx->jobCompleted_mutex;
|
||||||
|
ctx->jobs[u].jobCompleted_cond = &ctx->jobCompleted_cond;
|
||||||
|
ctx->jobs[u].jobReady_mutex = &ctx->jobReady_mutex;
|
||||||
|
ctx->jobs[u].jobReady_cond = &ctx->jobReady_cond;
|
||||||
|
}
|
||||||
|
}
|
||||||
ctx->nextJobID = 0;
|
ctx->nextJobID = 0;
|
||||||
ctx->threadError = 0;
|
ctx->threadError = 0;
|
||||||
ctx->allJobsCompleted = 0;
|
ctx->allJobsCompleted = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user