aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/base.zig
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-08-21 16:26:07 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-21 16:26:07 -0700
commit664119841a92d13a297e88032f9985fe7e35f77c (patch)
tree0fe664b158d2313d42bb20d6f10b795194a206bb /src/bun.js/base.zig
parent397182b400067be7b5293899fb3855524d07d8bf (diff)
downloadbun-664119841a92d13a297e88032f9985fe7e35f77c.tar.gz
bun-664119841a92d13a297e88032f9985fe7e35f77c.tar.zst
bun-664119841a92d13a297e88032f9985fe7e35f77c.zip
Implement `napi_ref_threadsafe_function` (#4156)
* Implement napi_ref_threadsafe_function * work on this * i hate event loops * little better * clean
Diffstat (limited to 'src/bun.js/base.zig')
-rw-r--r--src/bun.js/base.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bun.js/base.zig b/src/bun.js/base.zig
index b08b82c40..e72e196a3 100644
--- a/src/bun.js/base.zig
+++ b/src/bun.js/base.zig
@@ -1682,6 +1682,14 @@ pub const PollRef = struct {
this.status = .active;
vm.uws_event_loop.?.refConcurrently();
}
+
+ pub fn refConcurrentlyFromEventLoop(this: *PollRef, loop: *JSC.EventLoop) void {
+ this.refConcurrently(loop.virtual_machine);
+ }
+
+ pub fn unrefConcurrentlyFromEventLoop(this: *PollRef, loop: *JSC.EventLoop) void {
+ this.unrefConcurrently(loop.virtual_machine);
+ }
};
const KQueueGenerationNumber = if (Environment.isMac and Environment.allow_assert) usize else u0;