Lines Matching refs:data
41 data: [AtomicPtr<T>; VERSIONS],
48 pub(crate) fn new(data: T) -> Self {
49 let val = Box::new(data);
55 data: datas,
74 // This data could already be nullptr in the following execution order
77 // 3. writer sets old data to nullptr
80 // 6. reader acquires the old data using the old version
82 let data = self.data[version].load(Ordering::SeqCst);
83 if data.is_null() {
87 // this is safe because we just check the data is not nullptr, which means the
88 // writer has not yet released this data. The reader adds the holder
89 // count before acquire the data, the writer will not release the
90 // data until the all readers get dropped.
91 let data = unsafe { &*data };
94 data,
120 pub(crate) data: &'a T,
134 self.data
151 self.lock.data[new_version].store(val_ptr, Ordering::SeqCst);
154 let old_data = self.lock.data[old_version].swap(null_mut(), Ordering::SeqCst);
158 // the old data is valid and currently no one is holding it,
170 let data = self.lock.data[self.version].load(Ordering::SeqCst);
171 // the write guard always points to a valid data ptr
172 unsafe { &*data }