Browse Source

Fixed incorrect scope_guard

Paul-Louis Ageneau 4 years ago
parent
commit
8cbcb35bf4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/threadpool.cpp

+ 2 - 2
src/threadpool.cpp

@@ -67,7 +67,7 @@ void ThreadPool::join() {
 
 void ThreadPool::run() {
 	++mBusyWorkers;
-	scope_guard([&]() { --mBusyWorkers; });
+	scope_guard guard([&]() { --mBusyWorkers; });
 	while (runOne()) {
 	}
 }
@@ -94,7 +94,7 @@ std::function<void()> ThreadPool::dequeue() {
 		}
 
 		--mBusyWorkers;
-		scope_guard([&]() { ++mBusyWorkers; });
+		scope_guard guard([&]() { ++mBusyWorkers; });
 		mWaitingCondition.notify_all();
 		if(time)
 			mTasksCondition.wait_until(lock, *time);