-
Notifications
You must be signed in to change notification settings - Fork 264
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
Async: !Send
#2980
Async: !Send
#2980
Conversation
b2dcb47
to
c728cca
Compare
32b6be9
to
3189e14
Compare
Okay I've given this PR more thought, and I think the Sendness and Syncness of driver are separate concern. We're mostly taking Blocking drivers are probably fine to be Send, but they should be !Sync, so that the interrupt handlers can't cause a data race with them. We could then introduce the split interrupt handler struct along with a SyncBlocking mode, that separates the interrupt setup/handling parts from the blocking driver, and allows interrupts to be handled without locking the driver itself. I'm not convinced it's a good idea to do, but it would be possible. |
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.
LGTM
This PR adds the inherent functions meant by #2905 to the stabilized drivers and I2S.
This PR marks
Async: !Send
so that async drivers can't be sent to a different core with an interrupt handler in place.Sync
-ness of driver should be a separate concern that should be evaluated on a per-driver basis.Implementations that are both Async and safe to Send can unsafely implement Send.
Closes #1525