use std::sync::Arc;
#[cfg(feature = "thread-safe-tables")]
use parking_lot::RawRwLock as LockImpl;
#[cfg(not(feature = "thread-safe-tables"))]
use refcell_lock_api::raw::CellRwLock as LockImpl;
pub type RefCounted<T> = lock_api::RwLock<LockImpl, T>;
pub type RefShared<T> = Arc<RefCounted<T>>;
pub type RefGuard<T> = lock_api::ArcRwLockWriteGuard<LockImpl, T>;
pub fn new_shared_ref<T>(inner: T) -> RefShared<T> {
Arc::new(RefCounted::new(inner))
}
pub fn new_counted_ref<T>(inner: T) -> RefCounted<T> {
RefCounted::new(inner)
}