#lock-files #pid-file #lock #file #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

#273 in Filesystem

Download history 458/week @ 2024-07-20 219/week @ 2024-07-27 218/week @ 2024-08-03 212/week @ 2024-08-10 207/week @ 2024-08-17 212/week @ 2024-08-24 185/week @ 2024-08-31 200/week @ 2024-09-07 207/week @ 2024-09-14 340/week @ 2024-09-21 239/week @ 2024-09-28 176/week @ 2024-10-05 357/week @ 2024-10-12 210/week @ 2024-10-19 256/week @ 2024-10-26 186/week @ 2024-11-02

1,030 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–12MB
~74K SLoC