diff options
| author | Botahamec <botahamec@outlook.com> | 2024-05-22 20:59:09 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2024-05-22 20:59:09 -0400 |
| commit | 878f4fae4d3c6e64ab3824bf3fc012fbb5293a21 (patch) | |
| tree | f6550c400decbc1805c5957460177380d7c94718 /README.md | |
| parent | 1ed88daa00d478472181f0987112a2b0f2266694 (diff) | |
Documentation
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -48,7 +48,10 @@ let data = data.lock(&mut key); println!("{}", *data); ``` -Unlocking a mutex requires a `ThreadKey` or a mutable reference to `ThreadKey`. Each thread will be allowed to have one key at a time, but no more than that. The `ThreadKey` type is not cloneable or copyable. This means that only one thing can be locked at a time. +Unlocking a mutex requires a `ThreadKey` or a mutable reference to `ThreadKey`. +Each thread will be allowed to have one key at a time, but no more than that. +The `ThreadKey` type is not cloneable or copyable. This means that only one +thing can be locked at a time. To lock multiple mutexes at a time, create a `LockCollection`. @@ -76,7 +79,8 @@ println!("{}", *data.0); println!("{}", *data.1); ``` -In many cases, the [`LockCollection::new`] or [`LockCollection::new_ref`] method can be used, improving performance. +In many cases, the [`LockCollection::new`] or [`LockCollection::new_ref`] +method can be used, improving performance. ```rust use std::thread; |
