Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 26595f1624 | |||
| 9774052fd1 |
@@ -5,7 +5,7 @@
|
||||
# - "[SS|TSP] The <sched.h> header shall define the time_t type as described in <sys/types.h>."
|
||||
# - "The <sched.h> header shall define the timespec structure as described in <time.h>."
|
||||
# - "Inclusion of the <sched.h> header may make visible all symbols from the <time.h> header."
|
||||
sys_includes = ["sys/types.h"]
|
||||
sys_includes = ["sys/types.h", "stdint.h"]
|
||||
include_guard = "_RELIBC_SCHED_H"
|
||||
after_includes = """
|
||||
#include <bits/timespec.h> // for timespec
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -136,11 +136,7 @@ impl RlctMutex {
|
||||
Err(thread) => {
|
||||
let owner = thread & INDEX_MASK;
|
||||
|
||||
if !crate::pthread::mutex_owner_id_is_live(owner) {
|
||||
if !self.robust {
|
||||
return Err(Errno(ENOTRECOVERABLE));
|
||||
}
|
||||
|
||||
if self.robust && !crate::pthread::mutex_owner_id_is_live(owner) {
|
||||
let new_value = (thread & WAITING_BIT) | FUTEX_OWNER_DIED | this_thread;
|
||||
match self.inner.compare_exchange(
|
||||
thread,
|
||||
@@ -234,15 +230,7 @@ impl RlctMutex {
|
||||
return Err(Errno(EDEADLK));
|
||||
}
|
||||
|
||||
if current & FUTEX_OWNER_DIED != 0 && owner == 0 {
|
||||
return Err(Errno(ENOTRECOVERABLE));
|
||||
}
|
||||
|
||||
if current & FUTEX_OWNER_DIED != 0 || (owner != 0 && !crate::pthread::mutex_owner_id_is_live(owner)) {
|
||||
if !self.robust {
|
||||
return Err(Errno(ENOTRECOVERABLE));
|
||||
}
|
||||
|
||||
if self.robust && (current & FUTEX_OWNER_DIED != 0 || (owner != 0 && !crate::pthread::mutex_owner_id_is_live(owner))) {
|
||||
let new_value = (current & WAITING_BIT) | FUTEX_OWNER_DIED | this_thread;
|
||||
match self.inner.compare_exchange(
|
||||
current,
|
||||
|
||||
Reference in New Issue
Block a user