Static vidi::util::flock::LOCKF_LOCKS

source ·
static LOCKF_LOCKS: Mutex<Vec<u64>>
Expand description

According to https://gavv.net/articles/file-locks/#lockf-function, lockf is stored in the kernel as [i-node, pid] pairs, allowing the process to access the device freely. Thus, the kernel alone will not prevent another piece of code in the same process from acquiring the same resource. For instance, another library, or another linked copy of libcamera. But we need each instance to be separate, so let’s keep a list of open instances here, and reject those used already.