Implement UnwindSafe/RefUnwindSafe

This commit is contained in:
Stjepan Glavina 2020-07-31 14:26:39 +02:00
parent 5c5663e220
commit c680f8d84f
2 changed files with 7 additions and 3 deletions

View File

@ -13,8 +13,8 @@ categories = ["concurrency"]
readme = "README.md"
[dependencies]
cache-padded = "1.0.0"
cache-padded = "1.1.1"
[dev-dependencies]
easy-parallel = "2.1.0"
fastrand = "1.0.0"
easy-parallel = "3.1.0"
fastrand = "1.3.3"

View File

@ -32,6 +32,7 @@
use std::error;
use std::fmt;
use std::panic::{RefUnwindSafe, UnwindSafe};
use std::sync::atomic::{self, AtomicUsize, Ordering};
use crate::bounded::Bounded;
@ -62,6 +63,9 @@ pub struct ConcurrentQueue<T>(Inner<T>);
unsafe impl<T: Send> Send for ConcurrentQueue<T> {}
unsafe impl<T: Send> Sync for ConcurrentQueue<T> {}
impl<T> UnwindSafe for ConcurrentQueue<T> {}
impl<T> RefUnwindSafe for ConcurrentQueue<T> {}
enum Inner<T> {
Bounded(Bounded<T>),
Unbounded(Unbounded<T>),