about summary refs log tree commit diff
path: root/library/std/src/sys/pal/windows/thread.rs
AgeCommit message (Collapse)AuthorLines
2025-09-08std: move `thread` into `sys` (rename only)joboet-148/+0
2025-08-14Windows: Replace `GetThreadId`+`GetCurrentThread` with `GetCurrentThreadId`Trevor Gross-1/+1
Reference: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadid
2025-08-06Print thread ID in panic message if thread name is unknownTrevor Gross-0/+8
`panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print.
2025-07-28thread name in stack overflow messagejoboet-1/+5
2025-07-06sleep_until: use clock_nanosleep where possibledvdsk-1/+9
Using clock nanosleep leads to more accurate sleep times on platforms where it is supported. To enable using clock_nanosleep this makes `sleep_until` platform specific. That unfortunatly requires identical placeholder implementations for the other platforms (windows/mac/wasm etc). we will land platform specific implementations for those later. See the `sleep_until` tracking issue. This requires an accessors for the Instant type. As that accessor is only used on the platforms that have clock_nanosleep it is marked as allow_unused. 32bit time_t targets do not use clock_nanosleep atm, they instead rely on the same placeholder as the other platforms. We could make them use clock_nanosleep too in the future using `__clock_nanosleep_time64`. __clock_nanosleep_time64 is documented at: https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
2024-12-20mri: add track_caller to thread spawning methods for better backtracesRalf Jung-0/+1
2024-10-25library: consistently use American spelling for 'behavior'Ralf Jung-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-10/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-16Add unsafe blocks in unsafe Thread::newChris Denton-13/+17
2024-07-15allow(unsafe_op_in_unsafe_fn) on some functionsChris Denton-2/+3
These need to get their safety story straight
2024-07-15Rollup merge of #127750 - ChrisDenton:safe-unsafe-unsafe, r=workingjubileeJubilee-0/+1
Make os/windows and pal/windows default to `#![deny(unsafe_op_in_unsafe_fn)]` This is to prevent regressions in modules that currently pass. I did also fix up a few trivial places where the module contained only one or two simple wrappers. In more complex cases we should try to ensure the `unsafe` blocks are appropriately scoped and have any appropriate safety comments. This does not fix the windows bits of #127747 but it should help prevent regressions until that is done and also make it more obvious specifically which modules need attention.
2024-07-15Make pal/windows default to deny unsafe in unsafeChris Denton-0/+1
2024-07-15Remove DWORDChris Denton-1/+1
2024-04-12Add `unsafe` to two functions with safety invariantsEduardo Sánchez Muñoz-12/+14
2024-04-11Factor some common `io::Error` constantsBenoît du Garreau-4/+1
2024-04-09Windows: set main thread name without reencodingChris Denton-3/+7
2024-04-05Revert #121666Chris Denton-24/+0
This reverts #121666 due to #123495
2024-04-02Avoid panicking unnecessarily on startupChris Denton-3/+2
2024-03-31std: move `thread::current` TLS variable out of `thread_info`joboet-11/+0
2024-03-06Document and test minimal stack size on WindowsChris Denton-0/+2
2024-03-06Remove unnecessary fixmeChris Denton-5/+0
As the FIXME itself notes, there's nothing to fix here.
2024-02-27Use the OS thread name by default for the current threadChris Denton-1/+24
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-1/+1
2024-02-15Use generic `NonZero` internally.Markus Reiter-3/+3
2024-01-11std: begin moving platform support modules into `pal`joboet-0/+137