smol-rs / concurrent-queue

Concurrent multi-producer multi-consumer queue
Apache License 2.0
254 stars 22 forks source link

Implement UnwindSafe? #2

Closed akhilles closed 4 years ago

akhilles commented 4 years ago

Can ConcurrentQueue implement the UnwindSafe trait? Currently, it can't be used within panic::catch_unwind:

the type std::cell::UnsafeCell<std::mem::MaybeUninit<std::sync::Arc<pala_types::message::Message<pala_types::transaction::LedgerTx>>>> may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary

ghost commented 4 years ago

Yes it can :) I just published a new version where ConcurrentQueue implements UnwindSafe and RefUnwindSafe.