rust/library/std/src/thread
Matthias Krüger 30ec1f0384
Rollup merge of #84083 - ltratt:threadid_doc_tweak, r=dtolnay
Clarify the guarantees that ThreadId does and doesn't make.

The existing documentation does not spell out whether `ThreadId`s are unique during the lifetime of a thread or of a process. I had to examine the source code to realise (pleasingly!) that they're unique for the lifetime of a process. That seems worth documenting clearly, as it's a strong guarantee.

Examining the way `ThreadId`s are created also made me realise that the `as_u64` method on `ThreadId` could be a trap for the unwary on those platforms where the platform's notion of a thread identifier is also a 64 bit integer (particularly if they happen to use a similar identifier scheme to `ThreadId`). I therefore think it's worth being even clearer that there's no relationship between the two.
2022-01-01 22:49:47 +01:00
..
local Squashed implementation of the pass 2021-06-20 16:09:42 +02:00
local.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
mod.rs Rollup merge of #84083 - ltratt:threadid_doc_tweak, r=dtolnay 2022-01-01 22:49:47 +01:00
tests.rs Update stdlib to the 2021 edition 2021-12-18 00:21:53 +11:00