mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 18:03:25 +00:00
Use relaxed ordering for polling instant
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
4df7654034
commit
94b23e077d
@ -171,7 +171,7 @@ impl IfaceCommon {
|
|||||||
drop(interface);
|
drop(interface);
|
||||||
|
|
||||||
if let Some(instant) = poll_at {
|
if let Some(instant) = poll_at {
|
||||||
let old_instant = self.next_poll_at_ms.load(Ordering::Acquire);
|
let old_instant = self.next_poll_at_ms.load(Ordering::Relaxed);
|
||||||
let new_instant = instant.total_millis() as u64;
|
let new_instant = instant.total_millis() as u64;
|
||||||
self.next_poll_at_ms.store(new_instant, Ordering::Relaxed);
|
self.next_poll_at_ms.store(new_instant, Ordering::Relaxed);
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ impl IfaceCommon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn next_poll_at_ms(&self) -> Option<u64> {
|
pub(super) fn next_poll_at_ms(&self) -> Option<u64> {
|
||||||
let millis = self.next_poll_at_ms.load(Ordering::SeqCst);
|
let millis = self.next_poll_at_ms.load(Ordering::Relaxed);
|
||||||
if millis == 0 {
|
if millis == 0 {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user