diff options
Diffstat (limited to 'ext/ffi/00_ffi.js')
-rw-r--r-- | ext/ffi/00_ffi.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/ffi/00_ffi.js b/ext/ffi/00_ffi.js index 553ea1dd3..c7fdd0e8c 100644 --- a/ext/ffi/00_ffi.js +++ b/ext/ffi/00_ffi.js @@ -13,8 +13,15 @@ this.#rid = core.opSync("op_ffi_load", { path, symbols }); for (const symbol in symbols) { - this.symbols[symbol] = (...parameters) => - core.opSync("op_ffi_call", { rid: this.#rid, symbol, parameters }); + this.symbols[symbol] = symbols[symbol].nonblocking + ? (...parameters) => + core.opAsync("op_ffi_call_nonblocking", { + rid: this.#rid, + symbol, + parameters, + }) + : (...parameters) => + core.opSync("op_ffi_call", { rid: this.#rid, symbol, parameters }); } } |