You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good catch, but I think the documentation promises a #t result instead of #f when the current thread is not the handler thread. I'm not sure that was the right choice, but it's more consistent with a (void) result, so probably we want to align with the documentation.
My reading of the documentation for yield is that a #f result is expected in this case (a yield call without a positional arg):
If no argument is provided, yield dispatches an unspecified number of events, but only if the current thread is the current eventspace’s handler thread (otherwise, there is no effect). The result is #t if any events may have been handled, #f otherwise.
It does say #t is expected if called in a non-handler thread, but only if a 'wait positional argument is provided
If v is 'wait [...]
[...]
When called in a non-handler thread, yield returns immediately. In either case, the result is #t.
Ah, I didn't look at enough context to see that yield/no-sync is a function used only internally. It looks like that function always called via constrained-replay, though, which would make sure that it's called in a handler thread. If I have that right, maybe yield/no-sync should skip the check or complain if it's called in the wrong eventspace.
Meanwhile, I see how the documentation can be read your way — and your way matches the implementation of the non-internal functions. I'll look at revising the docs to make them unambiguous to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed that
yield/no-synccould potentially returnvoid?in addition to#tor#f, which seems like a potential bug.