aboutsummaryrefslogtreecommitdiff
path: root/src/napi/napi.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-07-22 04:31:58 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-22 04:31:58 -0700
commitc6a3467625fede0fe9901ab53b0aabd651866b64 (patch)
tree6cdd9bfd79756e97081b45de5323a7bbde62ceff /src/napi/napi.zig
parent636cec03e10ab487b1df3057aaab60b4d2b02c99 (diff)
downloadbun-c6a3467625fede0fe9901ab53b0aabd651866b64.tar.gz
bun-c6a3467625fede0fe9901ab53b0aabd651866b64.tar.zst
bun-c6a3467625fede0fe9901ab53b0aabd651866b64.zip
Unified event loop (#3741)
* Unified event loop * Update WebKit, add test for es-module-lexer * Update README.md * Use async wasm * Explicitly set whether concurrenttask should be deinit'd * Update package.json --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/napi/napi.zig')
-rw-r--r--src/napi/napi.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/napi/napi.zig b/src/napi/napi.zig
index bb8f19df2..abe8316ad 100644
--- a/src/napi/napi.zig
+++ b/src/napi/napi.zig
@@ -962,7 +962,7 @@ pub const napi_async_work = struct {
this.execute.?(this.global, this.ctx);
this.status.store(@intFromEnum(Status.completed), .SeqCst);
- this.event_loop.enqueueTaskConcurrent(this.concurrent_task.from(this));
+ this.event_loop.enqueueTaskConcurrent(this.concurrent_task.from(this, .manual_deinit));
}
pub fn schedule(this: *napi_async_work) void {
@@ -1338,7 +1338,7 @@ pub const ThreadSafeFunction = struct {
}
}
- this.event_loop.enqueueTaskConcurrent(this.concurrent_task.from(this));
+ this.event_loop.enqueueTaskConcurrent(this.concurrent_task.from(this, .manual_deinit));
}
pub fn finalize(opaq: *anyopaque) void {
@@ -1387,7 +1387,7 @@ pub const ThreadSafeFunction = struct {
if (this.owning_threads.count() == 0) {
this.finalizer_task = JSC.AnyTask{ .ctx = this, .callback = finalize };
- this.event_loop.enqueueTaskConcurrent(this.concurrent_finalizer_task.from(&this.finalizer_task));
+ this.event_loop.enqueueTaskConcurrent(this.concurrent_finalizer_task.from(&this.finalizer_task, .manual_deinit));
return;
}
}