moved reset of completion to right after wait
This commit is contained in:
@@ -678,10 +678,6 @@ static int createCompressionJob(adaptCCtx* ctx, size_t srcSize, int last)
|
|||||||
jobDescription* const job = &ctx->jobs[nextJobIndex];
|
jobDescription* const job = &ctx->jobs[nextJobIndex];
|
||||||
|
|
||||||
|
|
||||||
/* reset create completion */
|
|
||||||
pthread_mutex_lock(&ctx->createCompletion_mutex.pMutex);
|
|
||||||
ctx->createCompletion = 0;
|
|
||||||
pthread_mutex_unlock(&ctx->createCompletion_mutex.pMutex);
|
|
||||||
job->compressionLevel = ctx->compressionLevel;
|
job->compressionLevel = ctx->compressionLevel;
|
||||||
job->src.size = srcSize;
|
job->src.size = srcSize;
|
||||||
job->jobID = nextJob;
|
job->jobID = nextJob;
|
||||||
@@ -761,6 +757,11 @@ static int performCompression(adaptCCtx* ctx, FILE* const srcFile, outputThreadA
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&ctx->jobCompressed_mutex.pMutex);
|
pthread_mutex_unlock(&ctx->jobCompressed_mutex.pMutex);
|
||||||
|
|
||||||
|
/* reset create completion */
|
||||||
|
pthread_mutex_lock(&ctx->createCompletion_mutex.pMutex);
|
||||||
|
ctx->createCompletion = 0;
|
||||||
|
pthread_mutex_unlock(&ctx->createCompletion_mutex.pMutex);
|
||||||
|
|
||||||
while (remaining != 0 && !feof(srcFile)) {
|
while (remaining != 0 && !feof(srcFile)) {
|
||||||
size_t const ret = fread(ctx->input.buffer.start + ctx->input.filled + pos, 1, readBlockSize, srcFile);
|
size_t const ret = fread(ctx->input.buffer.start + ctx->input.filled + pos, 1, readBlockSize, srcFile);
|
||||||
if (ret != readBlockSize && !feof(srcFile)) {
|
if (ret != readBlockSize && !feof(srcFile)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user