Some minor fixes in userdata cell

This commit is contained in:
Alex Orlenko
2026-02-21 21:19:42 +00:00
parent 8fcb6a8416
commit 943c3aed58
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ use super::r#ref::{UserDataRef, UserDataRefMut};
type DynSerialize = dyn erased_serde::Serialize;
#[cfg(all(feature = "serde", feature = "send"))]
type DynSerialize = dyn erased_serde::Serialize + Send;
type DynSerialize = dyn erased_serde::Serialize + Send + Sync;
pub(crate) enum UserDataStorage<T> {
Owned(UserDataVariant<T>),
+1 -1
View File
@@ -72,7 +72,7 @@ mod lock_impl {
#[inline(always)]
fn try_lock_shared(&self) -> bool {
let flag = self.get().wrapping_add(1);
let flag = self.get().checked_add(1).expect("userdata lock count overflow");
if flag <= UNUSED {
return false;
}