diff options
| author | Mads Marquart <mads@marquart.dk> | 2024-05-06 02:40:48 +0200 |
|---|---|---|
| committer | Mads Marquart <mads@marquart.dk> | 2024-05-06 08:08:15 +0200 |
| commit | aa606bb246596dfc6797caa4570025e6f99457c3 (patch) | |
| tree | b46ac3960946b5a76d8a9d06c99e4659cee0fea9 /library/std/src/sys/pal/unix/mod.rs | |
| parent | c64889c537830e75311c4d6c48e9d243e8c97e23 (diff) | |
| download | rust-aa606bb246596dfc6797caa4570025e6f99457c3.tar.gz rust-aa606bb246596dfc6797caa4570025e6f99457c3.zip | |
iOS/tvOS/watchOS/visionOS: Set the main thread name
Tested in the iOS simulator that the thread name is not set by default, and that setting it improves the debugging experience in lldb / Xcode.
Diffstat (limited to 'library/std/src/sys/pal/unix/mod.rs')
| -rw-r--r-- | library/std/src/sys/pal/unix/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs index 1ac5729c02f..21f233e2262 100644 --- a/library/std/src/sys/pal/unix/mod.rs +++ b/library/std/src/sys/pal/unix/mod.rs @@ -63,11 +63,11 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { args::init(argc, argv); // Normally, `thread::spawn` will call `Thread::set_name` but since this thread - // already exists, we have to call it ourselves. We only do this on macos + // already exists, we have to call it ourselves. We only do this on Apple targets // because some unix-like operating systems such as Linux share process-id and // thread-id for the main thread and so renaming the main thread will rename the // process and we only want to enable this on platforms we've tested. - if cfg!(target_os = "macos") { + if cfg!(target_vendor = "apple") { thread::Thread::set_name(&c"main"); } |
