Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer requires yield to update #43954

Closed
IanButterworth opened this issue Jan 27, 2022 · 2 comments · Fixed by #43956
Closed

Timer requires yield to update #43954

IanButterworth opened this issue Jan 27, 2022 · 2 comments · Fixed by #43956

Comments

@IanButterworth
Copy link
Member

IanButterworth commented Jan 27, 2022

I assume this is expected behavior, but I wanted to check.

This will run indefinitely, not return after 1 second.

julia> begin
           t = Timer(1)
           while isopen(t)
           end
       end

Add a yield in the loop and it returns as expected.

If that is expected, I think adding a note to the Timer docstring would be helpful.

@IanButterworth
Copy link
Member Author

Perhaps isopen should yield to the timer?

@tkf
Copy link
Member

tkf commented Jan 27, 2022

I think isopen should be a non-synchronizing "racy" check. So, yes, I'd say it's expected.

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 a pull request may close this issue.

2 participants