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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user