summaryrefslogtreecommitdiff
path: root/examples/basic.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-11 16:33:26 -0400
committerMica White <botahamec@outlook.com>2024-03-11 16:33:26 -0400
commit462fc2d9aab8f0cba680caec344e4c388e9901b1 (patch)
tree6b401c5ed4920c2ec8093d5c49976fe0b72573c2 /examples/basic.rs
parent5eaa4fe1d3bfcda696122ba3d6b4914dba19ef96 (diff)
Documentation
Diffstat (limited to 'examples/basic.rs')
-rw-r--r--examples/basic.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/basic.rs b/examples/basic.rs
index 8842e16..1d611d3 100644
--- a/examples/basic.rs
+++ b/examples/basic.rs
@@ -10,7 +10,7 @@ fn main() {
let mut threads = Vec::new();
for _ in 0..N {
let th = thread::spawn(move || {
- let key = ThreadKey::lock().unwrap();
+ let key = ThreadKey::get().unwrap();
let mut data = DATA.lock(key);
*data += 1;
});
@@ -21,7 +21,7 @@ fn main() {
_ = th.join();
}
- let key = ThreadKey::lock().unwrap();
+ let key = ThreadKey::get().unwrap();
let data = DATA.lock(key);
println!("{}", *data);
}