Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/UtilsCtrl/ThreadPool/Queue/UAtomicQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ class UAtomicQueue : public UQueueObject {
* @return
*/
CVoid reset() {
ready_flag_ = false;
{
CGRAPH_UNIQUE_LOCK lk(mutex_);
ready_flag_ = false;
}
cv_.notify_all();
}

Expand All @@ -155,7 +158,10 @@ class UAtomicQueue : public UQueueObject {
* @return
*/
CVoid setup() {
ready_flag_ = true;
{
CGRAPH_UNIQUE_LOCK lk(mutex_);
ready_flag_ = true;
}
queue_ = {};
}

Expand Down
2 changes: 1 addition & 1 deletion src/UtilsCtrl/ThreadPool/Thread/UThreadSecondary.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class UThreadSecondary : public UThreadBase {
*/
CVoid waitRunTask(const CMSec ms) {
const auto& task = pool_task_queue_->popWithTimeout(ms);
if (nullptr != task) {
if (task) {
runTask(*task);
}
}
Expand Down
Loading