Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for Thread::{into_raw, from_raw} #97523

Open
3 tasks
ibraheemdev opened this issue May 29, 2022 · 0 comments
Open
3 tasks

Tracking Issue for Thread::{into_raw, from_raw} #97523

ibraheemdev opened this issue May 29, 2022 · 0 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@ibraheemdev
Copy link
Member

ibraheemdev commented May 29, 2022

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 guarantee that Thread can always be represented as a pointer/integer?
@ibraheemdev ibraheemdev added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant