Skip to content

Conversation

@pkit
Copy link
Contributor

@pkit pkit commented Dec 26, 2025

use the normal closure logic for the inter on func special closures

fixes #12176

use the normal closure logic for the inter on func special closures
Copy link
Collaborator

@ayushr2 ayushr2 left a comment

Choose a reason for hiding this comment

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

Thanks for your patch and for also adding tests!

// their parent. We expect the same locks held on exit as
// on entry - any locks acquired in the closure should be
// released before yielding.
if rls.count() != parent.count() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it theoretically possible that the closure acquires a new lock and while unlocking an old lock, making the count equal? Should we be using !rls.isCompatible(parent) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think it's possible. I will change it and check the tests.
The problem with testing this failures is that I won't get line number and thus the "standard" test machinery (+checkfailure) doesn't really work.

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.

[checklocks] Support iterators

2 participants