PidLock

mill.client.lock.PidLock
class PidLock(path: String) extends Lock

A lock implementation that uses atomic file creation and PID + timestamp checking. This works on filesystems that don't support file locking (e.g. Docker containers on macOS), but at the cost of potential race conditions.

The lock file contains "pid:startTime" which uniquely identifies a process even if PIDs are reused after a process dies.

Attributes

Source
PidLock.scala
Graph
Supertypes
class Lock
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def close(): Unit

Attributes

Definition Classes
AutoCloseable
Source
PidLock.scala
override def delete(): Unit

Attributes

Definition Classes
Source
PidLock.scala
override def lock(): Locked

Attributes

Definition Classes
Source
PidLock.scala
override def probe(): Boolean

Returns true if the lock is available for taking.

Returns true if the lock is available for taking.

Attributes

Definition Classes
Source
PidLock.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
PidLock.scala
override def tryLock(): TryLocked

Attributes

Definition Classes
Source
PidLock.scala

Inherited methods

def await(): Unit

Attributes

Inherited from:
Lock
Source
Lock.scala