Feature gate: #![feature(thread_raw)]
This is a tracking issue for Thread::into_raw and Thread::from_raw.
These functions allow conversions between a Thread and a raw pointer, which is useful in concurrent code as it allows storing a Thread in an AtomicPtr.
Public API
// std::thread
impl Thread {
fn into_raw(self) -> *const ();
unsafe fn from_raw(ptr: *const ()) -> Thread;
}
Steps / History
Unresolved Questions
- Do we want to commit to guaranteeing that
Thread can always be represented as a pointer/integer?
Feature gate:
#![feature(thread_raw)]This is a tracking issue for
Thread::into_rawandThread::from_raw.These functions allow conversions between a
Threadand a raw pointer, which is useful in concurrent code as it allows storing aThreadin anAtomicPtr.Public API
Steps / History
Thread::into_rawandThread::from_rawlibs-team#200Thread::{into_raw, from_raw}#97524Unresolved Questions
Threadcan always be represented as a pointer/integer?