[Fabric] Add enumerateWithBlock: for surface registry#24056
[Fabric] Add enumerateWithBlock: for surface registry#24056zhongwuzw wants to merge 9 commits intofacebook:masterfrom
Conversation
|
I think we should fix it a bit differently. |
shergin
left a comment
There was a problem hiding this comment.
... that way we can ensure that we iterate over the actual representation of the collection and avoid races. And that's a bit more efficient.
|
@shergin , seems we should make some trade-off, IMO, if we should release lock after finished enumeration, maybe it's worse than copy collection, for example, currently, we use it in |
|
Which exact trade-off do you mean? LMK if you need a detailed explanation of proposed method. |
|
Yeah, |
|
Well, if we'll have a dead lock in that case, it will indicate a much more severe logical problem. |
|
@shergin 👌 , I changed the method signature and add the block parameter. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This pull request was successfully merged by @zhongwuzw in 27e7279. When will my fix make it into a release? | Upcoming Releases |
Summary
To ensure all methods in surface registry thread safe, add copy to enumerator method.
cc. @shergin .
Changelog
[iOS] [Fixed] - Add copy for surface registry when return enumerator
Test Plan
N/A.