rust/library/std/src/thread
Matthias Krüger 2ba0c627de
Rollup merge of #123879 - beetrees:missing-unsafe, r=Mark-Simulacrum
Add missing `unsafe` to some internal `std` functions

Adds `unsafe` to a few internal functions that have safety requirements but were previously not marked as `unsafe`. Specifically:

- `std::sys::pal::unix:🧵:min_stack_size` needs to be `unsafe` as `__pthread_get_minstack` might dereference the passed pointer. All callers currently pass a valid initialised `libc::pthread_attr_t`.
- `std:🧵:Thread::new` (and `new_inner`) need to be `unsafe` as it requires the passed thread name to be valid UTF-8, otherwise `Thread::name` will trigger undefined behaviour. I've taken the opportunity to split out the unnamed thread case into a separate `new_unnamed` function to make the safety requirement clearer. All callers meet the safety requirement now that #123505 has been merged.
2024-04-14 09:01:58 +02:00
..
local SeqCst->Relaxed in thread local test. 2024-03-20 15:38:09 +01:00
local.rs Change method calls to using the method directly 2024-04-08 17:48:07 -04:00
mod.rs Rollup merge of #123879 - beetrees:missing-unsafe, r=Mark-Simulacrum 2024-04-14 09:01:58 +02:00
scoped.rs Move rare overflow error to a cold function 2024-04-11 22:23:49 +01:00
tests.rs Rollup merge of #123505 - ChrisDenton:revert-121666, r=workingjubilee 2024-04-05 22:33:28 +02:00