mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-23 07:35:30 +00:00
Fixed incorrect scope_guard
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user