Tier 2: robust mutex cleanup in thread exit path

exit_current_thread() now calls mark_robust_mutexes_dead(this) before
thread teardown, ensuring robust mutexes held by exiting threads are
properly marked as dead and ownership transferred to waiters.
This commit is contained in:
Red Bear OS
2026-07-02 21:40:50 +03:00
parent 9774052fd1
commit 26595f1624
+3
View File
@@ -317,6 +317,9 @@ pub unsafe fn exit_current_thread(retval: Retval) -> ! {
unsafe { header::tls::run_all_destructors() };
let this = current_thread().expect("failed to obtain current thread when exiting");
crate::sync::pthread_mutex::mark_robust_mutexes_dead(this);
let stack_base = this.stack_base;
let stack_size = this.stack_size;