From fdfceebecf8635cbc0290fd253290903a0874b98 Mon Sep 17 00:00:00 2001 From: dufresne_andy Date: Mon, 26 Feb 2024 17:40:35 +0800 Subject: [PATCH 1/2] Description:fix usb uevent queue mechanism Feature or Bugfix:Bugfix Binary Source: No Signed-off-by: dufresne_andy --- usb/ddk/host/src/ddk_uevent_queue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usb/ddk/host/src/ddk_uevent_queue.cpp b/usb/ddk/host/src/ddk_uevent_queue.cpp index 2c30cb09bc..f0031babe1 100644 --- a/usb/ddk/host/src/ddk_uevent_queue.cpp +++ b/usb/ddk/host/src/ddk_uevent_queue.cpp @@ -161,9 +161,8 @@ void TaskQueue::Init(void) if (taskQueue_.size() > 0) { DdkUeventTaskInfo task = taskQueue_.front(); taskQueue_.pop(); - queueLock_.unlock(); - conditionVariable_.notify_one(); DdkDispatchUevent(&task); + uniqueLock.unlock(); } } }; @@ -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); -- Gitee From 683ec03c489ee457c61fcaa681773b28d9bd3882 Mon Sep 17 00:00:00 2001 From: Zhao Zhen Date: Mon, 26 Feb 2024 12:43:22 +0000 Subject: [PATCH 2/2] update usb/ddk/host/src/ddk_uevent_queue.cpp. Signed-off-by: Zhao Zhen --- usb/ddk/host/src/ddk_uevent_queue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/ddk/host/src/ddk_uevent_queue.cpp b/usb/ddk/host/src/ddk_uevent_queue.cpp index f0031babe1..5c1a316a46 100644 --- a/usb/ddk/host/src/ddk_uevent_queue.cpp +++ b/usb/ddk/host/src/ddk_uevent_queue.cpp @@ -161,8 +161,8 @@ void TaskQueue::Init(void) if (taskQueue_.size() > 0) { DdkUeventTaskInfo task = taskQueue_.front(); taskQueue_.pop(); - DdkDispatchUevent(&task); uniqueLock.unlock(); + DdkDispatchUevent(&task); } } }; -- Gitee