You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// NOTE(unsafe): This function must not be used concurrently with itself,
/// but it can be used concurrently with put.
pubunsafefntake(&self) -> Option<T>{
It is claimed that put and take can be called concurrently. Both methods call UnsafeCell::get()
Ensure that the access is unique (no active references, mutable or not) when casting to &mut T
But put calls MaybeUninit::write() which casts it to &mut MaybeUninit<T>. You do not guarantee that the reference is unique, given that there could be a concurrent &MaybeUninit<T> in a concurrent call to take.
The text was updated successfully, but these errors were encountered:
async-heapless/src/oneshot.rs
Lines 175 to 177 in 835ae89
It is claimed that
put
andtake
can be called concurrently. Both methods callUnsafeCell::get()
But
put
callsMaybeUninit::write()
which casts it to&mut MaybeUninit<T>
. You do not guarantee that the reference is unique, given that there could be a concurrent&MaybeUninit<T>
in a concurrent call totake
.The text was updated successfully, but these errors were encountered: