prevents cpu reordering
use std::ops::Deref;
use std::sync::atomic::Ordering;
-use std::sync::atomic::Ordering::Acquire;
use std::sync::Arc;
use tracing::debug;
@@ -56,8 +55,7 @@ impl Drop for SessionRef {
impl Session {
pub fn destroy_session_ref(self: &Arc<Self>) {
- if self.ref_count.fetch_sub(1, Ordering::Release) == 1 {
- std::sync::atomic::fence(Acquire);
+ if self.ref_count.fetch_sub(1, Ordering::Relaxed) == 1 {
debug!("Destroy session {}", self.id);
self.session_mgr.destroy_session(&self.id);
self.quit();
