Skip to content

Fix PAGImageView deadlock caused by animator update re-entering mutex#3407

Merged
shlzxjp merged 1 commit intomainfrom
fix/thunderllei_pagimageview_deadlock
Apr 27, 2026
Merged

Fix PAGImageView deadlock caused by animator update re-entering mutex#3407
shlzxjp merged 1 commit intomainfrom
fix/thunderllei_pagimageview_deadlock

Conversation

@leiyue123
Copy link
Copy Markdown
Collaborator

修复 iOS 和 OHOS 平台上 PAGImageView 因 animator update 回调重入 mutex 导致的死锁问题。

在 iOS 端,setBounds/setFrame 方法持有 imageViewLock 后调用 [animator update],而 update 会同步回调 flush 再次尝试获取 imageViewLock,导致同一线程对非递归互斥锁的重入死锁。修复方式是将 [animator update] 调用移到锁作用域之外。

在 OHOS 端,onSurfaceCreated 同样存在持锁调用 _animator->update() 导致 onAnimationUpdate 回调重入 locker 的问题,采用相同策略修复。

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.49%. Comparing base (e625182) to head (9202832).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3407      +/-   ##
==========================================
+ Coverage   78.45%   78.49%   +0.03%     
==========================================
  Files         532      532              
  Lines       41448    41448              
  Branches    12486    12486              
==========================================
+ Hits        32520    32535      +15     
+ Misses       6386     6380       -6     
+ Partials     2542     2533       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/platform/ios/PAGImageView.mm Outdated
}
}
}
[self handleSizeChangedFromOldSize:oldBounds.size toNewSize:bounds.size];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleSizeChanged就可以了,优化下函数名

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@leiyue123 leiyue123 force-pushed the fix/thunderllei_pagimageview_deadlock branch from 515052e to 9202832 Compare April 27, 2026 09:17
@shlzxjp shlzxjp merged commit 96a6e0a into main Apr 27, 2026
8 checks passed
@shlzxjp shlzxjp deleted the fix/thunderllei_pagimageview_deadlock branch April 27, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants