-
Notifications
You must be signed in to change notification settings - Fork 208
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
Systimer improvements #2451
Systimer improvements #2451
Conversation
.modify(|_, w| w.update().set_bit()); | ||
} | ||
/// Reads the current counter value. | ||
fn read_count(&self) -> u64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any objections against moving this synchronization logic into Alarm
and leaving Unit as the low level API (i.e. update and poll)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much, besides the desire to not expose footgun parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that read_count()
is expensive, do I have a stronger argument? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about now, now that it's cheap again? 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I don't think I have a strong enough case anymore haha
.modify(|_, w| w.update().set_bit()); | ||
} | ||
/// Reads the current counter value. | ||
fn read_count(&self) -> u64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that read_count()
is expensive, do I have a stronger argument? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems I cannot reproduce the original issue, but the changes look good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Closes #2431
Closes #2432
At least in theory, I did not spend time reproducing the race issue. I do not think we can test the race condition easily so I didn't add a test case.