mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
e98cc18686a91e958a34b218c03986c93fa05723
ExecuteSkillDone and OnTimeout previously invoked callback->OnExecuteDone under mutex_. Since ffrt::mutex is non-recursive, a synchronous re-entry from the remote side back into SkillExecuteManager deadlocked the event handler thread. Even without re-entry, holding the lock across an outbound IPC while the business process is unresponsive stalls every other SkillExecuteManager operation. Move the callback invocation outside the critical section: flip the record state, run cleanup (RemoveSkillExecuteTimeoutLocked, RemoveRecord) under the lock, then drop the lock before issuing OnExecuteDone. Collapse OnTimeout's two-phase critical section into one to remove the TOCTOU window. Add skill_execute_manager_test covering happy paths, missing-record and state-mismatch failures, duplicate seq, post-done timeout, and the two re-entrancy scenarios that would have deadlocked pre-fix. Co-Authored-By: Agent Signed-off-by: RuiChen_01 <chenrui193@huawei.com> 🤖 AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: claude (glm-5.2) <ai@local>
Description
暂无描述
Languages
C++
98.1%
C
1.5%
JavaScript
0.2%
TypeScript
0.1%