From 4b1ce50d67b92ae3c9434455397f86c37df287bd Mon Sep 17 00:00:00 2001 From: Jeehoon Kang Date: Fri, 13 Nov 2020 01:22:35 +0900 Subject: [PATCH] Fix a bug in seq_lock_wide (closes #595) --- crossbeam-utils/src/atomic/seq_lock_wide.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crossbeam-utils/src/atomic/seq_lock_wide.rs b/crossbeam-utils/src/atomic/seq_lock_wide.rs index faabc1b72..871a93d28 100644 --- a/crossbeam-utils/src/atomic/seq_lock_wide.rs +++ b/crossbeam-utils/src/atomic/seq_lock_wide.rs @@ -1,3 +1,4 @@ +use core::mem; use core::sync::atomic::{self, AtomicUsize, Ordering}; use crate::Backoff; @@ -110,6 +111,7 @@ impl SeqLockWriteGuard { #[inline] pub fn abort(self) { self.lock.state_lo.store(self.state_lo, Ordering::Release); + mem::forget(self); } }