summaryrefslogtreecommitdiff
path: root/examples/dining_philosophers.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2024-05-23 19:54:38 -0400
committerBotahamec <botahamec@outlook.com>2024-05-23 19:54:38 -0400
commit046c93cbea3236b7adf9e473d299345ee985cbb2 (patch)
tree47cb8d1d1add67c0a8a5f3b86edf89ff4c03c4bf /examples/dining_philosophers.rs
parent698dd9dac7f0ca02ded9b3a56b45ac71a7dbbb04 (diff)
Another dining philosophers test
Diffstat (limited to 'examples/dining_philosophers.rs')
-rw-r--r--examples/dining_philosophers.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/dining_philosophers.rs b/examples/dining_philosophers.rs
index 1340564..dc4dd51 100644
--- a/examples/dining_philosophers.rs
+++ b/examples/dining_philosophers.rs
@@ -1,6 +1,6 @@
use std::{thread, time::Duration};
-use happylock::{collection::RefLockCollection, Mutex, ThreadKey};
+use happylock::{collection, Mutex, ThreadKey};
static PHILOSOPHERS: [Philosopher; 5] = [
Philosopher {
@@ -51,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 { RefLockCollection::new_unchecked(&forks) };
+ let forks = unsafe { collection::RefLockCollection::new_unchecked(&forks) };
let forks = forks.lock(key);
println!("{} is eating...", self.name);
thread::sleep(Duration::from_secs(1));