Skip to content

Conversation

@jerith
Copy link
Contributor

@jerith jerith commented Mar 3, 2013

This changes the behaviour of Thread#recursion_guard and adds Thread#recursion_guard_outer in order to allow more flexibility in how recursion is handled in Ruby code. In addition, recursion detection is now based on a function identifier rather being global to prevent nested guards from different functions interfering with each other.

Copy link
Member

Choose a reason for hiding this comment

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

This should be using the underlying strings, not the symbols.

Copy link
Member

Choose a reason for hiding this comment

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

Why the change in API from returning the the in_recursion value to yielding it to the block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran into a case where not letting the block decide what to do when recursion is detected made things difficult, but I'm not sure if that's an issue anymore.

@alex
Copy link
Member

alex commented Mar 7, 2013

Sorry, I'm still thinking this over :/

Copy link
Member

Choose a reason for hiding this comment

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

This isn't used yet, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but I need it for Array#hash in #456.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is becoming my official theme song, but let's split this up :D, so this just has the identifier for recursion guards.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should it have Thread.in_recursion_guard? as well? That's only used by the outer guard.

Copy link
Member

Choose a reason for hiding this comment

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

Nope, just what's needed. :)

Copy link
Member

Choose a reason for hiding this comment

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

Should have been more precise, just what's needed for the recursion_guard() changes.

Conflicts:
	tests/objects/test_threadobject.py
	topaz/objects/threadobject.py
@jerith
Copy link
Contributor Author

jerith commented Mar 17, 2013

This branch is very messy with all the merging and whatnot that's happened. If you prefer, I can make a clean one and just commit the final diff to it.

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.

2 participants