fix(napi): impl send + sync for ThreadsafeFunction (#1622)
This commit is contained in:
parent
7e2b75cc33
commit
53cd1bc904
1 changed files with 3 additions and 0 deletions
|
@ -235,6 +235,9 @@ pub struct ThreadsafeFunction<T: 'static, ES: ErrorStrategy::T = ErrorStrategy::
|
||||||
_phantom: PhantomData<(T, ES)>,
|
_phantom: PhantomData<(T, ES)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl<T: 'static, ES: ErrorStrategy::T> Send for ThreadsafeFunction<T, ES> {}
|
||||||
|
unsafe impl<T: 'static, ES: ErrorStrategy::T> Sync for ThreadsafeFunction<T, ES> {}
|
||||||
|
|
||||||
impl<T: 'static, ES: ErrorStrategy::T> Clone for ThreadsafeFunction<T, ES> {
|
impl<T: 'static, ES: ErrorStrategy::T> Clone for ThreadsafeFunction<T, ES> {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
self.handle.with_read_aborted(|aborted| {
|
self.handle.with_read_aborted(|aborted| {
|
||||||
|
|
Loading…
Reference in a new issue