diff options
| author | Ralf Jung <post@ralfj.de> | 2025-08-26 18:12:36 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-09-03 09:14:25 +0200 |
| commit | 39d51d04e706dee462ac4a17508ed87eb52e7715 (patch) | |
| tree | 6a8aaabd8164f0c687d53f9a3b2735c0945873ff /library/std/src/thread/tests.rs | |
| parent | 5ab69249f36678c0a770a08d3d1b28a8103349ff (diff) | |
| download | rust-39d51d04e706dee462ac4a17508ed87eb52e7715.tar.gz rust-39d51d04e706dee462ac4a17508ed87eb52e7715.zip | |
thread parking: fix docs and examples
Diffstat (limited to 'library/std/src/thread/tests.rs')
| -rw-r--r-- | library/std/src/thread/tests.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs index ae889f1e778..2117f5f93ce 100644 --- a/library/std/src/thread/tests.rs +++ b/library/std/src/thread/tests.rs @@ -287,6 +287,8 @@ fn test_park_unpark_called_other_thread() { for _ in 0..10 { let th = thread::current(); + // Here we rely on `thread::spawn` (specifically the part that runs after spawning + // the thread) to not consume the parking token. let _guard = thread::spawn(move || { super::sleep(Duration::from_millis(50)); th.unpark(); @@ -316,6 +318,8 @@ fn test_park_timeout_unpark_called_other_thread() { for _ in 0..10 { let th = thread::current(); + // Here we rely on `thread::spawn` (specifically the part that runs after spawning + // the thread) to not consume the parking token. let _guard = thread::spawn(move || { super::sleep(Duration::from_millis(50)); th.unpark(); |
