Skip to content

Commit

Permalink
Change: use scoped_lock on move constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mjshakir committed Dec 1, 2024
1 parent b8cfd04 commit 4584a15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ThreadTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ThreadPool::ThreadTask::ThreadTask(ThreadTask&& other) noexcept : m_priority(o
m_state(other.m_state) {

{
std::lock_guard<std::mutex> lock(m_mutex);
std::scoped_lock lock(m_mutex, other.m_mutex);
m_function = std::move(other.m_function);
m_promise = std::move(other.m_promise);
}
Expand Down

0 comments on commit 4584a15

Please sign in to comment.