Skip to content

From Stream do not call yield() when _timeout is 0. #6242

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

Merged
merged 3 commits into from
Jul 5, 2019

Conversation

mhightower83
Copy link
Contributor

It is not safe to call yield() from some callback contexts. In Stream.cpp timedRead() and timedPeek() always call yield() when a character is not available, even when _timeout == 0. This is unnecessary when the Stream class is used as a base class that is referencing a block of preset memory. The StreamString class is an example. With this change, these calls to yield() can be suppressed by a call to .setTimeout(0).

@d-a-v d-a-v merged commit ad2b51e into esp8266:master Jul 5, 2019
@mhightower83 mhightower83 deleted the pr2 branch August 19, 2019 16:42
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.

3 participants