summaryrefslogtreecommitdiff
path: root/examples/list.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-13 22:44:46 -0400
committerMica White <botahamec@outlook.com>2024-03-13 22:44:46 -0400
commit7bd236853ef5ae705328c8fdc492cf60fc6887c1 (patch)
treeec4e9dced562fdae618b98ac704074c0ddc9cc41 /examples/list.rs
parent7c6f49b6570669098938dc332a4f3e85dd3d217d (diff)
Lockable overhaul
Diffstat (limited to 'examples/list.rs')
-rw-r--r--examples/list.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/list.rs b/examples/list.rs
index 3b03f2d..cf344e7 100644
--- a/examples/list.rs
+++ b/examples/list.rs
@@ -1,6 +1,6 @@
use std::thread;
-use happylock::{LockCollection, Mutex, ThreadKey};
+use happylock::{Mutex, RefLockCollection, ThreadKey};
const N: usize = 10;
@@ -37,7 +37,7 @@ fn main() {
data.push(&DATA[rand % 6]);
}
- let Some(lock) = LockCollection::try_new(data) else {
+ let Some(lock) = RefLockCollection::try_new(&data) else {
continue;
};
let mut guard = lock.lock(&mut key);
@@ -56,7 +56,7 @@ fn main() {
}
let key = ThreadKey::get().unwrap();
- let data = LockCollection::new_ref(&DATA);
+ let data = RefLockCollection::new(&DATA);
let data = data.lock(key);
for val in &*data {
println!("{}", **val);