aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-22 02:38:36 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-22 02:38:36 -0700
commit2ca1861a54e831c44dae0044097726fd32e80725 (patch)
tree66723a9218a7d4fad4151f37436e19567cf247af /src
parentce9daa48572a345ffd95e41d9f64b9e4719a88fa (diff)
downloadbun-2ca1861a54e831c44dae0044097726fd32e80725.tar.gz
bun-2ca1861a54e831c44dae0044097726fd32e80725.tar.zst
bun-2ca1861a54e831c44dae0044097726fd32e80725.zip
Remove a mutex when enqueuing concurrent tasks
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/event_loop.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index d4688beac..d8f0338ed 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -414,12 +414,12 @@ pub const EventLoop = struct {
if (this.virtual_machine.uws_event_loop == null) {
var actual = uws.Loop.get().?;
this.virtual_machine.uws_event_loop = actual;
- _ = actual.addPostHandler(*JSC.EventLoop, this, JSC.EventLoop.tick);
+ _ = actual.addPostHandler(*JSC.EventLoop, this, JSC.EventLoop.afterUSocketsTick);
_ = actual.addPreHandler(*JSC.VM, this.virtual_machine.global.vm(), JSC.VM.drainMicrotasks);
}
}
- pub fn onDefer(this: *EventLoop) void {
+ pub fn afterUSocketsTick(this: *EventLoop) void {
this.defer_count.store(0, .Monotonic);
this.tick();
}
@@ -432,7 +432,7 @@ pub const EventLoop = struct {
if (this.virtual_machine.uws_event_loop) |loop| {
const deferCount = this.defer_count.fetchAdd(1, .Monotonic);
if (deferCount == 0) {
- loop.nextTick(*EventLoop, this, onDefer);
+ loop.wakeup();
}
}
}