]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
compression thread should take measurements independently based on whether or not...
authorPaul Cruz <paulcruz74@fb.com>
Mon, 24 Jul 2017 22:14:58 +0000 (15:14 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Mon, 24 Jul 2017 22:14:58 +0000 (15:14 -0700)
contrib/adaptive-compression/adapt.c

index ec40130a6ef69149e259089a3924485cefd8e999..ef0da42f82ae65c42afada29348475fecaf81f91 100644 (file)
@@ -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);