mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 01:43:22 +00:00
Enable RCU to read reference to stored pointers
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
36f6f9bcd4
commit
a21e895102
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user