From faa0143281c86f67b3274c01c52843f4384fd9da Mon Sep 17 00:00:00 2001 From: l30032580 Date: Sun, 7 Apr 2024 15:04:57 +0800 Subject: [PATCH 1/2] IssueNo: https://gitee.com/openharmony/window_window_manager_lite/issues/I9EH7W Feature or Bugfix: Bugfix Binary Source:No --- services/ims/input_event_client_proxy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ims/input_event_client_proxy.cpp b/services/ims/input_event_client_proxy.cpp index fe5486b..900b1a5 100644 --- a/services/ims/input_event_client_proxy.cpp +++ b/services/ims/input_event_client_proxy.cpp @@ -45,9 +45,11 @@ void InputEventClientProxy::ClientRequestHandle(int funcId, void* origin, IpcIo* void InputEventClientProxy::AddListener(const void* origin, IpcIo* req, IpcIo* reply) { if (clientInfoMap_.size() >= MAX_CLIENT_SIZE) { + pthread_mutex_unlock(&lock_); GRAPHIC_LOGE("Exceeded the maximum number!"); return; } + pthread_mutex_unlock(&lock_); pid_t pid = GetCallingPid(); SvcIdentity svc = {0}; bool ret = ReadRemoteObject(req, &svc); @@ -76,12 +78,14 @@ void InputEventClientProxy::DeathCallback(void* origin) void InputEventClientProxy::RemoveListener(const void* origin, IpcIo* req, IpcIo* reply) { pid_t pid = GetCallingPid(); + pthread_mutex_lock(&lock_); if (clientInfoMap_.count(pid) > 0) { ReleaseSvc(clientInfoMap_[pid].svc); pthread_mutex_lock(&lock_); clientInfoMap_.erase(pid); pthread_mutex_unlock(&lock_); } + pthread_mutex_unlock(&lock_); } void InputEventClientProxy::OnRawEvent(const RawEvent& event) -- Gitee From 0c85bb767cb7217782d27677e4d9a21c0eb049f1 Mon Sep 17 00:00:00 2001 From: l30032580 Date: Sun, 7 Apr 2024 15:04:57 +0800 Subject: [PATCH 2/2] Feature or Bugfix: Bugfix Binary Source:No Signed-off-by: lixinpeng --- services/ims/input_event_client_proxy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ims/input_event_client_proxy.cpp b/services/ims/input_event_client_proxy.cpp index fe5486b..900b1a5 100644 --- a/services/ims/input_event_client_proxy.cpp +++ b/services/ims/input_event_client_proxy.cpp @@ -45,9 +45,11 @@ void InputEventClientProxy::ClientRequestHandle(int funcId, void* origin, IpcIo* void InputEventClientProxy::AddListener(const void* origin, IpcIo* req, IpcIo* reply) { if (clientInfoMap_.size() >= MAX_CLIENT_SIZE) { + pthread_mutex_unlock(&lock_); GRAPHIC_LOGE("Exceeded the maximum number!"); return; } + pthread_mutex_unlock(&lock_); pid_t pid = GetCallingPid(); SvcIdentity svc = {0}; bool ret = ReadRemoteObject(req, &svc); @@ -76,12 +78,14 @@ void InputEventClientProxy::DeathCallback(void* origin) void InputEventClientProxy::RemoveListener(const void* origin, IpcIo* req, IpcIo* reply) { pid_t pid = GetCallingPid(); + pthread_mutex_lock(&lock_); if (clientInfoMap_.count(pid) > 0) { ReleaseSvc(clientInfoMap_[pid].svc); pthread_mutex_lock(&lock_); clientInfoMap_.erase(pid); pthread_mutex_unlock(&lock_); } + pthread_mutex_unlock(&lock_); } void InputEventClientProxy::OnRawEvent(const RawEvent& event) -- Gitee