-
-
Notifications
You must be signed in to change notification settings - Fork 779
DeferredCall: Port to SingleThreadValue
#4566
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
base: master
Are you sure you want to change the base?
Conversation
This removes the static muts and uses STV instead.
9368a5e to
0df0209
Compare
| /// # Safety | ||
| /// | ||
| /// Callers of this function must ensure that this function is never called | ||
| /// concurrently with other calls to [`initialize_debug_writer_wrapper_unsafe`]. |
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.
Callers also need to avoid calling this concurrently with initialize_debug_writer_wrapper().
| /// # Safety | ||
| /// | ||
| /// Callers of this function must ensure that this function is never called | ||
| /// concurrently with other calls to [`initialize_deferred_call_state_unsafe`]. |
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.
Same here: callers cannot call this concurrently with initialize_deferred_call_state.
| bit | ||
| if let Some(defcalls_cell) = DEFCALLS.get() { | ||
| defcalls_cell.map_or(None, |defcalls| { | ||
| if let Some(bitmask) = BITMASK.get() { |
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.
if let Some(bitmask) = BITMASK.get() else { return None };
/* Rest of closure */| } | ||
|
|
||
| // Allow dead code because we need the `Chip` type but don't use `chip`. | ||
| #[allow(dead_code)] |
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.
I don't see any reference to Chip in this file. What changed to require this annotation?
Pull Request Overview
This is an example of using SingleThreadValue for DeferredCall. This is implemented on top of
#4551#4624.Testing Strategy
TODO or Help Wanted
I don't know if there is a way to check that these functions are always called in every tock build.
Documentation Updated
/docs, or no updates are required.Formatting
make prepush.