diff options
Diffstat (limited to 'examples/double_mutex.rs')
| -rw-r--r-- | examples/double_mutex.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/double_mutex.rs b/examples/double_mutex.rs index e2b08df..e9a9c77 100644 --- a/examples/double_mutex.rs +++ b/examples/double_mutex.rs @@ -1,5 +1,6 @@ use std::thread; +use happylock::collection::RetryingLockCollection; use happylock::{collection::RefLockCollection, Mutex, ThreadKey}; const N: usize = 10; @@ -11,7 +12,7 @@ fn main() { for _ in 0..N { let th = thread::spawn(move || { let key = ThreadKey::get().unwrap(); - let lock = RefLockCollection::new(&DATA); + let lock = RetryingLockCollection::new_ref(&DATA); let mut guard = lock.lock(key); *guard.1 = (100 - *guard.0).to_string(); *guard.0 += 1; |
