From: Paul Cruz Date: Mon, 24 Jul 2017 22:14:58 +0000 (-0700) Subject: compression thread should take measurements independently based on whether or not... X-Git-Tag: v1.3.1^2~13^2^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dc83ca64c9e5f0e87d08daf5b349e59ef97d5e1;p=thirdparty%2Fzstd.git compression thread should take measurements independently based on whether or not the create/write thread will actually bottleneck performance --- diff --git a/contrib/adaptive-compression/adapt.c b/contrib/adaptive-compression/adapt.c index ec40130a6..ef0da42f8 100644 --- a/contrib/adaptive-compression/adapt.c +++ b/contrib/adaptive-compression/adapt.c @@ -412,14 +412,17 @@ static void* compressionThread(void* arg) pthread_mutex_unlock(&ctx->jobWrite_mutex.pMutex); - if (willWaitForCreate || willWaitForWrite) { - DEBUG(2, "compression will wait for create or write on job %u\n", currJob); - + if (willWaitForCreate) { + DEBUG(2, "compression will wait for create on job %u\n", currJob); pthread_mutex_lock(&ctx->createCompletion_mutex.pMutex); ctx->compressWaitCreateCompletion = ctx->createCompletion; DEBUG(2, "create completion %f\n", ctx->compressWaitCreateCompletion); pthread_mutex_unlock(&ctx->createCompletion_mutex.pMutex); + } + + if (willWaitForWrite) { + DEBUG(2, "compression will wait for write on job %u\n", currJob); pthread_mutex_lock(&ctx->writeCompletion_mutex.pMutex); ctx->compressWaitWriteCompletion = ctx->writeCompletion; DEBUG(2, "write completion %f\n", ctx->compressWaitWriteCompletion);