Skip to main content

another_instance_running

Function another_instance_running 

Source
pub fn another_instance_running() -> bool
Expand description

Whether another copy is running for this user, since two would share the download temp files, cache.json and a game folder’s ledger unguarded.

A named mutex needs no cleanup after a crash. Local\ scopes it to the logon session, because Global\ needs a privilege a standard user may lack. The handle that wins is never closed, so the name lives as long as the process; one that finds the name taken is, or it would keep the mutex alive after its owner exits.