pub(crate) struct LightWorkWindowGate {
active_centers: SyncMutex<Vec<ChunkPos>>,
released: Notify,
}Expand description
Shared gate used to exclude overlapping light-engine cache windows.
Light worksets can write light data across a full 5x5 cache window. Two
worksets whose windows overlap must therefore not run at the same time:
chunk-light status work must publish ChunkStatus::Light before overlapping
work builds its light cache, and queued light updates must not interleave
with either operation.
Fields§
§active_centers: SyncMutex<Vec<ChunkPos>>§released: NotifyImplementations§
Source§impl LightWorkWindowGate
impl LightWorkWindowGate
Sourcepub(crate) async fn reserve_centered(
self: &Arc<Self>,
center: ChunkPos,
) -> LightWorkWindowReservation
pub(crate) async fn reserve_centered( self: &Arc<Self>, center: ChunkPos, ) -> LightWorkWindowReservation
Reserves the radius-2 light cache window centered on center.
Sourcepub(crate) fn try_reserve_centered(
self: &Arc<Self>,
center: ChunkPos,
) -> Option<LightWorkWindowReservation>
pub(crate) fn try_reserve_centered( self: &Arc<Self>, center: ChunkPos, ) -> Option<LightWorkWindowReservation>
Attempts to reserve the radius-2 light cache window centered on center.
const fn windows_overlap(left: ChunkPos, right: ChunkPos) -> bool
Trait Implementations§
Source§impl Debug for LightWorkWindowGate
impl Debug for LightWorkWindowGate
Auto Trait Implementations§
impl !Freeze for LightWorkWindowGate
impl !RefUnwindSafe for LightWorkWindowGate
impl Send for LightWorkWindowGate
impl Sync for LightWorkWindowGate
impl Unpin for LightWorkWindowGate
impl UnsafeUnpin for LightWorkWindowGate
impl UnwindSafe for LightWorkWindowGate
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>