mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 02:43:45 +00:00
xous: thread: mark thread_main() as divergent
The thread wrapper function never returns, so we can mark it as divergent. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
99b06594a8
commit
50e4fede24
@ -68,14 +68,18 @@ impl Thread {
|
||||
)
|
||||
.map_err(|code| io::Error::from_raw_os_error(code as i32))?;
|
||||
|
||||
extern "C" fn thread_start(main: *mut usize, guard_page_pre: usize, stack_size: usize) {
|
||||
extern "C" fn thread_start(
|
||||
main: *mut usize,
|
||||
guard_page_pre: usize,
|
||||
stack_size: usize,
|
||||
) -> ! {
|
||||
unsafe {
|
||||
// Finally, let's run some code.
|
||||
// Run the contents of the new thread.
|
||||
Box::from_raw(main as *mut Box<dyn FnOnce()>)();
|
||||
}
|
||||
|
||||
// Destroy TLS, which will free the TLS page and call the destructor for
|
||||
// any thread local storage.
|
||||
// any thread local storage (if any).
|
||||
unsafe {
|
||||
crate::sys::thread_local_key::destroy_tls();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user