summaryrefslogtreecommitdiff
path: root/examples/dining_philosophers.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2024-05-22 17:27:35 -0400
committerBotahamec <botahamec@outlook.com>2024-05-22 17:27:35 -0400
commitef191a3e8ecf4093fcd08036e35012c1af173a08 (patch)
tree9a6986986ad8392ae147c64c436214fa290773d7 /examples/dining_philosophers.rs
parentebbe3cfce28914d776f3e5f89894fab50911c57e (diff)
Documentation for types
Diffstat (limited to 'examples/dining_philosophers.rs')
-rw-r--r--examples/dining_philosophers.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/dining_philosophers.rs b/examples/dining_philosophers.rs
index 70826ba..1340564 100644
--- a/examples/dining_philosophers.rs
+++ b/examples/dining_philosophers.rs
@@ -1,6 +1,5 @@
use std::{thread, time::Duration};
-use happylock::collection::RetryingLockCollection;
use happylock::{collection::RefLockCollection, Mutex, ThreadKey};
static PHILOSOPHERS: [Philosopher; 5] = [
@@ -52,7 +51,7 @@ impl Philosopher {
// safety: no philosopher asks for the same fork twice
let forks = [&FORKS[self.left], &FORKS[self.right]];
- let forks = unsafe { RetryingLockCollection::new_unchecked(&forks) };
+ let forks = unsafe { RefLockCollection::new_unchecked(&forks) };
let forks = forks.lock(key);
println!("{} is eating...", self.name);
thread::sleep(Duration::from_secs(1));