struct RangeBlocked {
range: Range<u64>,
waitlist: Mutex<Vec<Sender<()>>>,
index: AtomicUsize,
}
Expand description
A range blocked for some kind of concurrent access.
Fields§
§range: Range<u64>
The range.
waitlist: Mutex<Vec<Sender<()>>>
List of requests awaiting the range to become unblocked.
When the corresponding RangeBlockedGuard
is dropped, these will all be awoken (via
oneshot::Sender::send(())
).
Normal non-async mutex, so do not await while locked!
index: AtomicUsize
Index in the corresponding RangeBlockedList.blocked
list, so it can be dropped quickly.
(When the corresponding RangeBlockedGuard
is dropped, this entry is swap-removed from the
blocked
list, and the other entry taking its place has its index
updated.)
Only access under blocked
lock!
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RangeBlocked
impl RefUnwindSafe for RangeBlocked
impl Send for RangeBlocked
impl Sync for RangeBlocked
impl Unpin for RangeBlocked
impl UnwindSafe for RangeBlocked
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more