Skip to content

Commit

Permalink
Rollup merge of rust-lang#122091 - ChrisDenton:comment, r=RalfJung
Browse files Browse the repository at this point in the history
Note why we're using a new thread in `test_get_os_named_thread`

`@RalfJung` expressed some "surprise and confusion" about why we're spawning a new thread in this test. Hopefully this comment will help future readers.
  • Loading branch information
matthiaskrgr committed Mar 6, 2024
2 parents 7cf69c0 + 9957736 commit 3fc4cf6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/thread/tests.rs
Expand Up @@ -80,6 +80,7 @@ fn test_named_thread_truncation() {
#[test]
fn test_get_os_named_thread() {
use crate::sys::thread::Thread;
// Spawn a new thread to avoid interfering with other tests running on this thread.
let handler = thread::spawn(|| {
let name = c"test me please";
Thread::set_name(name);
Expand Down

0 comments on commit 3fc4cf6

Please sign in to comment.