CacheLock

object CacheLock

One MCP per game dir — the cross-process half of CommonClass's in-JVM claim. Two instances sharing a cache dir rewrite each other's jars while the other still holds them open, so the loser starts nothing.

Properties

Link copied to clipboard
private var held: FileLock?

Held for the JVM's life: a collected lock closes its channel and releases. The FILE is never deleted — a second process holding that path open while a third recreates it leaves the two locking different files, both convinced they won.

Functions

Link copied to clipboard
fun claim(): String?