mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Merge branch 'v0.11'
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.7)
|
cmake_minimum_required(VERSION 3.7)
|
||||||
project(libdatachannel
|
project(libdatachannel
|
||||||
VERSION 0.11.9
|
VERSION 0.11.10
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
set(PROJECT_DESCRIPTION "WebRTC Data Channels Library")
|
set(PROJECT_DESCRIPTION "WebRTC Data Channels Library")
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ void ThreadPool::join() {
|
|||||||
|
|
||||||
void ThreadPool::run() {
|
void ThreadPool::run() {
|
||||||
++mBusyWorkers;
|
++mBusyWorkers;
|
||||||
scope_guard([&]() { --mBusyWorkers; });
|
scope_guard guard([&]() { --mBusyWorkers; });
|
||||||
while (runOne()) {
|
while (runOne()) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ std::function<void()> ThreadPool::dequeue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
--mBusyWorkers;
|
--mBusyWorkers;
|
||||||
scope_guard([&]() { ++mBusyWorkers; });
|
scope_guard guard([&]() { ++mBusyWorkers; });
|
||||||
mWaitingCondition.notify_all();
|
mWaitingCondition.notify_all();
|
||||||
if(time)
|
if(time)
|
||||||
mTasksCondition.wait_until(lock, *time);
|
mTasksCondition.wait_until(lock, *time);
|
||||||
|
@ -72,7 +72,7 @@ protected:
|
|||||||
std::function<void()> dequeue(); // returns null function if joining
|
std::function<void()> dequeue(); // returns null function if joining
|
||||||
|
|
||||||
std::vector<std::thread> mWorkers;
|
std::vector<std::thread> mWorkers;
|
||||||
int mBusyWorkers = 0;
|
std::atomic<int> mBusyWorkers = 0;
|
||||||
std::atomic<bool> mJoining = false;
|
std::atomic<bool> mJoining = false;
|
||||||
|
|
||||||
struct Task {
|
struct Task {
|
||||||
|
Reference in New Issue
Block a user