diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-05-18 13:43:52 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-05-18 13:43:52 +0200 |
commit | 3465f7d437712c1e3c52e094390957de16bb286e (patch) | |
tree | b75d27cd0f8c4c57ecd5fce8d7449c0c512e2f26 | |
parent | 2f418cff774a293457df66c0f67dc930c3abfc9c (diff) | |
parent | 29f8db08ae16e06c332481b7573aad7def7d2cc3 (diff) |
Merge branch 'state' into my-mastermy-master
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -14,7 +14,7 @@ pub enum PidlockError { type PidlockResult = Result<(), PidlockError>; #[derive(Debug, PartialEq)] -enum PidlockState { +pub enum PidlockState { New, Acquired, Released, @@ -66,6 +66,10 @@ impl Pidlock { } } + pub fn state(&self) -> &PidlockState { + &self.state + } + pub fn acquire(&mut self) -> PidlockResult { match self.state { PidlockState::New => {} |