We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
In line https://github.com/lobaro/FreeRTOS-rust/blob/master/freertos-rust/src/mutex.rs#L11 we can see the Mutex API requires the data it holds to have Sync trait for it to implement Sync.
Mutex
Sync
I wanted to understand the reason for this. I believe in the standard library Mutex will be Send+Sync if the data type is Send. https://doc.rust-lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E
Send+Sync
Send
This makes sense since Mutex is what provides the Sync feature for the data. If the data is already Sync, why would it need to be wrapped in a Mutex?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
In line https://github.com/lobaro/FreeRTOS-rust/blob/master/freertos-rust/src/mutex.rs#L11 we can see the
Mutex
API requires the data it holds to haveSync
trait for it to implementSync
.I wanted to understand the reason for this. I believe in the standard library
Mutex
will beSend+Sync
if the data type isSend
. https://doc.rust-lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3EThis makes sense since
Mutex
is what provides theSync
feature for the data. If the data is alreadySync
, why would it need to be wrapped in aMutex
?The text was updated successfully, but these errors were encountered: