We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73d1e08 commit 05f7269Copy full SHA for 05f7269
1 file changed
src/thread/linux_raw.rs
@@ -46,6 +46,16 @@ impl Thread {
46
Self(NonNull::new(raw.cast()).unwrap())
47
}
48
49
+ /// Convert to `Self` from a raw non-null pointer.
50
+ ///
51
+ /// # Safety
52
53
+ /// `raw` must be a valid non-null thread pointer.
54
+ #[inline]
55
+ pub unsafe fn from_raw_unchecked(raw: *mut c_void) -> Self {
56
+ Self(NonNull::new_unchecked(raw.cast()))
57
+ }
58
+
59
/// Convert to `Self` from a raw non-null pointer that was returned from
60
/// `Thread::to_raw_non_null`.
61
#[inline]
0 commit comments