summaryrefslogtreecommitdiff
path: root/ext/ffi/lib.rs
diff options
context:
space:
mode:
authorAapo Alasuutari <aapo.alasuutari@gmail.com>2023-05-07 13:31:01 +0300
committerGitHub <noreply@github.com>2023-05-07 10:31:01 +0000
commit0536ae86588328b773f82d9724cd816a86217583 (patch)
tree0655e5834c1a6ef15bee02f5e0bf3347fc12f8c4 /ext/ffi/lib.rs
parentb8c936076162e77039063126ee882d995f2c45de (diff)
fix(ext/ffi): UnsafeCallback can hang with 'deno test' (#19018)
Diffstat (limited to 'ext/ffi/lib.rs')
-rw-r--r--ext/ffi/lib.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs
index c11f08dd8..ccad69d73 100644
--- a/ext/ffi/lib.rs
+++ b/ext/ffi/lib.rs
@@ -2,7 +2,6 @@
use deno_core::error::AnyError;
use deno_core::futures::channel::mpsc;
-use deno_core::v8;
use deno_core::OpState;
use std::cell::RefCell;
@@ -10,7 +9,6 @@ use std::mem::size_of;
use std::os::raw::c_char;
use std::os::raw::c_short;
use std::path::Path;
-use std::ptr;
use std::rc::Rc;
mod call;
@@ -25,6 +23,7 @@ mod turbocall;
use call::op_ffi_call_nonblocking;
use call::op_ffi_call_ptr;
use call::op_ffi_call_ptr_nonblocking;
+use callback::op_ffi_unsafe_callback_close;
use callback::op_ffi_unsafe_callback_create;
use callback::op_ffi_unsafe_callback_ref;
use dlfcn::op_ffi_load;
@@ -43,10 +42,6 @@ const _: () = {
assert!(size_of::<*const ()>() == 8);
};
-thread_local! {
- static LOCAL_ISOLATE_POINTER: RefCell<*const v8::Isolate> = RefCell::new(ptr::null());
-}
-
pub(crate) const MAX_SAFE_INTEGER: isize = 9007199254740991;
pub(crate) const MIN_SAFE_INTEGER: isize = -9007199254740991;
@@ -109,6 +104,7 @@ deno_core::extension!(deno_ffi,
op_ffi_read_f64<P>,
op_ffi_read_ptr<P>,
op_ffi_unsafe_callback_create<P>,
+ op_ffi_unsafe_callback_close,
op_ffi_unsafe_callback_ref,
],
esm = [ "00_ffi.js" ],