fixed some issues with segfaults
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);
|
||||
ctx->numJobs = numJobs;
|
||||
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->threadError = 0;
|
||||
ctx->allJobsCompleted = 0;
|
||||
|
|
Loading…
Reference in New Issue