/// This function adds an item to the queue and wakes up at least one thread
/// waiting on the queue.
///
- /// @param item the new iten to be added to the queue
+ /// @param item the new item to be added to the queue
void push(WorkItem item) {
std::lock_guard<std::mutex> lock(mutex_);
queue_.push(item);
std::condition_variable cv_;
/// @brief the sate of the queue
- ///
/// The 'enabled' state corresponds to false value
/// The 'disabled' state corresponds to true value
std::atomic_bool exit_;
// lock on a non-recursive mutex resulting in a dead lock
dead_lock_ = true;
isc_throw(isc::InvalidOperation,
- "lock on already locked mutex resulting in deadlock");
+ "recursive lock on already locked mutex resulting in "
+ "dead lock");
} else {
// lock on a recursive mutex
if (this_thread::get_id() != id_) {
dead_lock_ = true;
isc_throw(isc::InvalidOperation,
"recursive lock on a different thread on already "
- "locked mutex resulting in deadlock");
+ "locked mutex resulting in dead lock");
}
}
}
/// @brief internal lock state of the mutex
int32_t lock_;
- /// @brief state which indicated that the mutex in in dead lock
+ /// @brief state which indicates that the mutex is in dead lock
bool dead_lock_;
/// @brief total number of locks performed on the mutex