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

#454 in Filesystem

Download history 282/week @ 2024-12-04 259/week @ 2024-12-11 153/week @ 2024-12-18 35/week @ 2024-12-25 160/week @ 2025-01-01 147/week @ 2025-01-08 176/week @ 2025-01-15 170/week @ 2025-01-22 109/week @ 2025-01-29 359/week @ 2025-02-05 244/week @ 2025-02-12 253/week @ 2025-02-19 223/week @ 2025-02-26 189/week @ 2025-03-05 290/week @ 2025-03-12 195/week @ 2025-03-19

922 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