#lock #file #file-lock #pidfile #server #locking

pidlock

A library for using pidfiles as resource locks

6 releases

0.1.6 Dec 16, 2023
0.1.4 Jan 20, 2021
0.1.2 Jun 4, 2018
0.1.1 May 19, 2018

#338 in Filesystem

Download history 23/week @ 2024-01-24 21/week @ 2024-01-31 39/week @ 2024-02-07 94/week @ 2024-02-14 187/week @ 2024-02-21 175/week @ 2024-02-28 121/week @ 2024-03-06 126/week @ 2024-03-13 175/week @ 2024-03-20 153/week @ 2024-03-27 146/week @ 2024-04-03 110/week @ 2024-04-10 146/week @ 2024-04-17 145/week @ 2024-04-24 126/week @ 2024-05-01 152/week @ 2024-05-08

592 downloads per month
Used in 13 crates (via amdgpu)

MIT license

13KB
288 lines

pidlock

A library for working with pidfiles, with a lock-like API.

Usage

extern crate pidlock;

fn main() {
    let mut lock = pidlock::Pidlock::new("/path/to/pidfile.pid");
    lock.acquire().unwrap();

    ...

    lock.release().unwrap();
}

License

pidlock is licensed under the MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

Dependencies

~0–13MB
~98K SLoC