From c1f4b36305d663f5b407d30d1a843a23525ff626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 31 Mar 2018 20:17:43 +0100 Subject: [PATCH] Fix mutex logic for cancelling operations. --- src/core/operationrunner.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/core/operationrunner.cpp b/src/core/operationrunner.cpp index 01771c7..7906172 100644 --- a/src/core/operationrunner.cpp +++ b/src/core/operationrunner.cpp @@ -73,9 +73,9 @@ void OperationRunner::run() for (int i = 0; i < numOperations(); i++) { suspendMutex().lock(); + suspendMutex().unlock(); if (!status || isCancelling()) { - suspendMutex().unlock(); break; } @@ -92,13 +92,6 @@ void OperationRunner::run() disconnect(op, &Operation::progress, this, &OperationRunner::progressSub); emit opFinished(i + 1, op); - - suspendMutex().unlock(); - - // Sleep a little to give others a chance to suspend us. This should normally not be - // required -- is it possible that the compiler just optimizes our unlock/lock away - // if we don't sleep? - msleep(5); } if (automounter)