If I register a RustFunction to quickjs and wrap it as a method which can be called in JS (let's call it js_native_func()). If I need to call some JS engine APIs in this RustFunction, then I need to call the context.with() method for the second time (the first time is when evaluating the JS code with js_native_func()), and a "single-thread deadlock" will occur.
If ReentrantLock can be used, it seems that this problem can be solved.
If I register a RustFunction to quickjs and wrap it as a method which can be called in JS (let's call it
js_native_func()). If I need to call some JS engine APIs in this RustFunction, then I need to call thecontext.with()method for the second time (the first time is when evaluating the JS code withjs_native_func()), and a "single-thread deadlock" will occur.If
ReentrantLockcan be used, it seems that this problem can be solved.