platform and pthread cleanup

This commit is contained in:
auronandace
2026-02-27 21:38:16 +00:00
parent 94325a10c9
commit 2d3ee10aef
4 changed files with 18 additions and 18 deletions
+4 -4
View File
@@ -168,7 +168,7 @@ pub(crate) unsafe fn create(
new_tcb.mspace = current_tcb.mspace;
let stack_end = unsafe { stack_base.add(stack_size) };
let mut stack = stack_end as *mut usize;
let mut stack = stack_end.cast::<usize>();
{
let mut push = |value: usize| {
stack = unsafe { stack.sub(1) };
@@ -184,8 +184,8 @@ pub(crate) unsafe fn create(
}
push(0);
push(0);
push(synchronization_mutex as *const _ as usize);
push(new_tcb as *mut _ as usize);
push(ptr::from_ref(synchronization_mutex) as usize);
push(ptr::from_mut(new_tcb) as usize);
push(arg as usize);
push(start_routine as usize);
@@ -204,7 +204,7 @@ pub(crate) unsafe fn create(
.lock()
.insert(os_tid, ForceSendSync(new_tcb));
Ok((&new_tcb.pthread) as *const _ as *mut _)
Ok(&raw const new_tcb.pthread as *mut _)
}
/// A shim to wrap thread entry points in logic to set up TLS, for example