Skip to content

Commit 3fb1369

Browse files
committed
Cppcheck
1 parent bba1f7c commit 3fb1369

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/cpr/threadpool.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ class ThreadPool {
183183
template <class Fn, class... Args>
184184
auto Submit(Fn&& fn, Args&&... args) {
185185
{
186-
const std::unique_lock lock(controlMutex);
186+
const std::unique_lock lockControl(controlMutex);
187187
// Add a new worker thread in case the tasks queue is not empty and we still can add a thread
188188
bool shouldAddThread{false};
189189
{
190-
std::unique_lock lock(taskQueueMutex);
190+
std::unique_lock lockQueue(taskQueueMutex);
191191
if (idleThreadCount <= tasks.size() && curThreadCount < maxThreadCount) {
192192
if (state == State::RUNNING) {
193193
shouldAddThread = true;

0 commit comments

Comments
 (0)