diff --git a/src/header/sched/cbindgen.toml b/src/header/sched/cbindgen.toml index 570e8f6f0b..c54d4ec488 100644 --- a/src/header/sched/cbindgen.toml +++ b/src/header/sched/cbindgen.toml @@ -5,7 +5,7 @@ # - "[SS|TSP] The header shall define the time_t type as described in ." # - "The header shall define the timespec structure as described in ." # - "Inclusion of the header may make visible all symbols from the header." -sys_includes = ["sys/types.h"] +sys_includes = ["sys/types.h", "stdint.h"] include_guard = "_RELIBC_SCHED_H" after_includes = """ #include // for timespec diff --git a/src/sync/pthread_mutex.rs b/src/sync/pthread_mutex.rs index b108f2ee6f..aa91bc20f7 100644 --- a/src/sync/pthread_mutex.rs +++ b/src/sync/pthread_mutex.rs @@ -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,