Switch to a boring mutex+condvar based barrier.

While the atomic version might be better, at the moment the priority is
to just to get RLCT working reliably.
This commit is contained in:
4lDO2
2023-04-30 17:33:28 +02:00
parent 4e5596698d
commit 79dfddf82c
2 changed files with 38 additions and 1 deletions
+7 -1
View File
@@ -45,7 +45,13 @@ impl Cond {
pub fn wait_inner_typedmutex<'lock, T>(&self, guard: crate::sync::MutexGuard<'lock, T>) -> crate::sync::MutexGuard<'lock, T> {
let mut newguard = None;
let lock = guard.mutex;
self.wait_inner_generic(|| Ok(drop(guard)), || Ok(newguard = Some(lock.lock())), |_| unreachable!(), None).unwrap();
self.wait_inner_generic(move || {
drop(guard);
Ok(())
}, || {
newguard = Some(lock.lock());
Ok(())
}, |_| unreachable!(), None).unwrap();
newguard.unwrap()
}
// TODO: FUTEX_REQUEUE