make F64Table concurency safe

This commit is contained in:
Bennet Bleßmann
2023-09-02 22:27:43 +02:00
parent c7ec5a13a5
commit 5928d64d7a
3 changed files with 114 additions and 63 deletions

View File

@@ -189,16 +189,24 @@ impl<T: ?Sized, M: ?Sized> RcuRef<T, M> {
})
}
pub fn same_epoch(this: &Self, other: &Self) -> bool {
pub fn same_epoch<M2>(this: &Self, other: &RcuRef<T, M2>) -> bool {
Arc::ptr_eq(&this.arc, &other.arc)
}
pub fn ptr_eq(this: &Self, other: &Self) -> bool {
this.data == other.data
}
pub fn clone(this: &Self) -> Self {
Self {
arc: Arc::clone(&this.arc),
data: this.data,
}
}
pub fn get_root(this: &Self) -> &T {
&this.arc
}
}
impl<T: ?Sized, M: ?Sized> Deref for RcuRef<T, M> {