Skip to content

Commit

Permalink
Rollup merge of #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 authored Mar 6, 2024
2 parents 75ebe83 + 9957736 commit 3827584
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/thread/tests.rs
Original file line number Diff line number Diff line change
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 3827584

Please sign in to comment.