mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-11-23 14:49:59 +00:00
!1235 修改IPC线程与回调注册线程为同一线程,posttask导致条件变量超时
Merge pull request !1235 from mashaoyin/master
This commit is contained in:
commit
1441e2a826
@ -840,14 +840,19 @@ void JsInputMethodEngineSetting::FreeWorkIfFail(int ret, uv_work_t *work)
|
||||
IMSA_HILOGE("uv_queue_work failed retCode:%{public}d", ret);
|
||||
}
|
||||
|
||||
void JsInputMethodEngineSetting::PostTaskToEventHandler(std::function<void()> task, const std::string &taskName)
|
||||
bool JsInputMethodEngineSetting::PostTaskToEventHandler(std::function<void()> task, const std::string &taskName)
|
||||
{
|
||||
auto eventHandler = GetEventHandler();
|
||||
if (eventHandler == nullptr) {
|
||||
IMSA_HILOGE("eventHandler is nullptr!");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (eventHandler == AppExecFwk::EventHandler::Current()) {
|
||||
IMSA_HILOGE("in current thread!");
|
||||
return false;
|
||||
}
|
||||
handler_->PostTask(task, taskName);
|
||||
return true;
|
||||
}
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
void OnSetSubtype(const SubProperty &property) override;
|
||||
void OnSecurityChange(int32_t security) override;
|
||||
void ReceivePrivateCommand(const std::unordered_map<std::string, PrivateDataValue> &privateCommand) override;
|
||||
void PostTaskToEventHandler(std::function<void()> task, const std::string &taskName) override;
|
||||
bool PostTaskToEventHandler(std::function<void()> task, const std::string &taskName) override;
|
||||
|
||||
private:
|
||||
struct PanelContext : public AsyncCall::Context {
|
||||
|
@ -256,11 +256,10 @@ int32_t InputMethodAbility::StartInput(const InputClientInfo &clientInfo, bool i
|
||||
startInputProcessHandler->SetValue(isCallbackFinished);
|
||||
};
|
||||
isPendingShowKeyboard_ = clientInfo.isShowKeyboard;
|
||||
if (imeListener_ != nullptr) {
|
||||
imeListener_->PostTaskToEventHandler(task, "startInput");
|
||||
if (imeListener_ != nullptr && imeListener_->PostTaskToEventHandler(task, "startInput")) {
|
||||
startInputProcessHandler->GetValue();
|
||||
} else {
|
||||
IMSA_HILOGE("imeListener_ is nullptr.");
|
||||
IMSA_HILOGE("imeListener_ is nullptr, or post task failed!");
|
||||
}
|
||||
return clientInfo.isShowKeyboard ? ShowKeyboard() : ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
@ -38,8 +38,9 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual void PostTaskToEventHandler(std::function<void()> task, const std::string &taskName)
|
||||
virtual bool PostTaskToEventHandler(std::function<void()> task, const std::string &taskName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
} // namespace MiscServices
|
||||
|
Loading…
Reference in New Issue
Block a user