Merge branch 'v0.11'

This commit is contained in:
Paul-Louis Ageneau
2021-03-10 18:59:54 +01:00
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.7)
project(libdatachannel
VERSION 0.11.9
VERSION 0.11.10
LANGUAGES CXX)
set(PROJECT_DESCRIPTION "WebRTC Data Channels Library")

View File

@ -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);

View File

@ -72,7 +72,7 @@ protected:
std::function<void()> dequeue(); // returns null function if joining
std::vector<std::thread> mWorkers;
int mBusyWorkers = 0;
std::atomic<int> mBusyWorkers = 0;
std::atomic<bool> mJoining = false;
struct Task {