diff --git a/usb/ddk/host/src/ddk_uevent_queue.cpp b/usb/ddk/host/src/ddk_uevent_queue.cpp index 2c30cb09bc6d745643c2e2ed18e95758ae30b447..5c1a316a46e6c715cf4c13a22aa5e40bac4c6573 100644 --- a/usb/ddk/host/src/ddk_uevent_queue.cpp +++ b/usb/ddk/host/src/ddk_uevent_queue.cpp @@ -161,8 +161,7 @@ void TaskQueue::Init(void) if (taskQueue_.size() > 0) { DdkUeventTaskInfo task = taskQueue_.front(); taskQueue_.pop(); - queueLock_.unlock(); - conditionVariable_.notify_one(); + uniqueLock.unlock(); DdkDispatchUevent(&task); } } @@ -195,6 +194,7 @@ int32_t TaskQueue::AddTask(const DdkUeventTaskInfo &task) std::lock_guard lock(queueLock_); if (taskQueue_.size() > MAX_TASK_NUM) { HDF_LOGE("%{public}s: task queue is full", __func__); + conditionVariable_.notify_one(); return HDF_FAILURE; } taskQueue_.emplace(task);