pub struct Lock {
pub took_over_stale: bool,
/* private fields */
}Expand description
Held for the duration of one tick, so two timers (a systemd one and a hand-run one) cannot run the same job twice.
Fields§
§took_over_stale: boolTrue when this tick took over an abandoned lock, so it can say so.
Implementations§
Source§impl Lock
impl Lock
pub fn path(&self) -> &Path
Sourcepub fn touch(&mut self, now_ms: i64) -> bool
pub fn touch(&mut self, now_ms: i64) -> bool
Say this tick is still working, between jobs.
#407: staleness is judged from the file’s mtime, which was set once and never refreshed,
so a tick that legitimately ran past STALE_LOCK_MS was taken for an abandoned one — the
next minute’s tick took the lock and ran the jobs this one had not reached yet, in both.
Returns false when the file is no longer ours, which means another tick has taken over and
this one must stop rather than fight over jobs.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Lock
impl Freeze for Lock
impl Move for Lock
impl RefUnwindSafe for Lock
impl Send for Lockwhere
RawVecInner: Send,
impl Sync for Lockwhere
RawVecInner: Sync,
impl Unpin for Lock
impl UnsafeUnpin for Lock
impl UnwindSafe for Lockwhere
RawVecInner: UnwindSafe,
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