Browse Source

Fixed benchmark

Paul-Louis Ageneau 5 years ago
parent
commit
82e604b869
1 changed files with 2 additions and 2 deletions
  1. 2 2
      test/benchmark.cpp

+ 2 - 2
test/benchmark.cpp

@@ -157,9 +157,9 @@ size_t benchmark(milliseconds duration) {
 		cout << "Received: " << receivedSize.load() / 1000 << " KB" << endl;
 		cout << "Received: " << receivedSize.load() / 1000 << " KB" << endl;
 	}
 	}
 
 
-	if (auto adc2 = std::atomic_load(&dc2); adc2->isOpen()) {
+	if (auto adc2 = std::atomic_load(&dc2)) {
 		dc1->close();
 		dc1->close();
-		while (!finished)
+		while (!finished && adc2->isOpen())
 			this_thread::sleep_for(100ms);
 			this_thread::sleep_for(100ms);
 	}
 	}