Enable RCU to read reference to stored pointers

This commit is contained in:
Chen Chengjun
2025-04-10 10:32:17 +08:00
committed by Tate, Hongliang Tian
parent 36f6f9bcd4
commit a21e895102
6 changed files with 244 additions and 181 deletions

View File

@ -26,10 +26,7 @@ pub(super) fn register_callback(func: fn()) {
Some(callbacks_vec) => {
let mut callbacks_cloned = callbacks_vec.clone();
callbacks_cloned.push(func);
if callbacks
.compare_exchange(Some(Box::new(callbacks_cloned)))
.is_ok()
{
if callbacks.compare_exchange(Some(callbacks_cloned)).is_ok() {
break;
}
}