This PR significantly reduces lock contention in the CCheckQueue
class by releasing a mutex before calling std::condition_variable::notify_one
and std::condition_variable::notify_all
.
From C++ docs:
The notifying thread does not need to hold the lock on the same mutex as the one held by the waiting thread(s); in fact doing so is a pessimization, since the notified thread would immediately block again, waiting for the notifying thread to release the lock.
Related to: