chore(napi): add Send and Sync to Reference (#2007)
This commit is contained in:
parent
4719caa643
commit
13651c5ff1
1 changed files with 3 additions and 0 deletions
|
@ -29,6 +29,9 @@ pub struct Reference<T: 'static> {
|
||||||
finalize_callbacks: Rc<Cell<*mut dyn FnOnce()>>,
|
finalize_callbacks: Rc<Cell<*mut dyn FnOnce()>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl<T: Send> Send for Reference<T> {}
|
||||||
|
unsafe impl<T: Sync> Sync for Reference<T> {}
|
||||||
|
|
||||||
impl<T> Drop for Reference<T> {
|
impl<T> Drop for Reference<T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let rc_strong_count = Rc::strong_count(&self.finalize_callbacks);
|
let rc_strong_count = Rc::strong_count(&self.finalize_callbacks);
|
||||||
|
|
Loading…
Reference in a new issue