-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Available yield #545
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
Available yield #545
Conversation
This reverts commit 4d3ef20.
Revert "Issue fixes"
Since there isn't a way to handle this yield issue in one single place, i would propose to reduce the amount of code duplication by refactoring this as follows.
void maybe_yield() {
if (micros() - esp_micros_at_task_start() > 10000) {
yield();
}
}
bool isAvailable = ... ; // depending on the class
if (!isAvailable) {
maybe_yield();
isAvailable = ...; // perhaps update isAvailable, depending on the class?
}
return isAvailable; |
Also i would like to merge your fixes in 4d3ef20. Would you mind if I rebase that change directly right now and then we go with a clean pull related to isAvailable? |
Go ahead and take the other, I will refactor this stuff and put out a new pull |
Note that #534 already contains the changes you want, just merge that. |
will the |
That's right, yield is non-reentrant, so calling it from Ticker or GPIO interrupt will cause an exception. |
yes |
My suggestion here is to yield only if available() was called more than once with zero result. |
this is replaced by #551 |
#540
NOTE: There is bleed over in the changes from a previous pull request, don't know how to clean that out other than revert it on my branch; BUT I DO NOT WANT TO REVERT THOSE CHANGES if they get merged in.