We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb93b45 commit 663e7abCopy full SHA for 663e7ab
library/std/src/sys/xous/thread.rs
@@ -68,14 +68,20 @@ impl Thread {
68
)
69
.map_err(|code| io::Error::from_raw_os_error(code as i32))?;
70
71
- extern "C" fn thread_start(main: *mut usize, guard_page_pre: usize, stack_size: usize) {
72
- unsafe {
73
- // Finally, let's run some code.
74
- Box::from_raw(main as *mut Box<dyn FnOnce()>)();
+ extern "C" fn thread_start(
+ main: *mut usize,
+ guard_page_pre: usize,
+ stack_size: usize,
75
+ ) -> ! {
76
+ {
77
+ unsafe {
78
+ // Run the contents of the new thread.
79
+ Box::from_raw(main as *mut Box<dyn FnOnce()>)();
80
+ }
81
}
82
83
// Destroy TLS, which will free the TLS page and call the destructor for
- // any thread local storage.
84
+ // any thread local storage (if any).
85
unsafe {
86
crate::sys::thread_local_key::destroy_tls();
87
0 commit comments