Skip to content

Commit

Permalink
seq_cst
Browse files Browse the repository at this point in the history
  • Loading branch information
190n committed Jan 24, 2025
1 parent 170d351 commit 46921ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bun.js/api/Timer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ pub const WTFTimer = struct {

pub fn update(this: *WTFTimer, seconds: f64, repeat: bool) void {
// There's only one of these.
this.imminent.store(if (seconds == 0) this else null, .monotonic);
this.imminent.store(if (seconds == 0) this else null, .seq_cst);

if (seconds == 0.0) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/bun.js/event_loop.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ pub const EventLoop = struct {
}

if (this.entered_event_loop_count < 2) {
if (this.imminent_gc_timer.swap(null, .monotonic)) |timer| {
if (this.imminent_gc_timer.swap(null, .seq_cst)) |timer| {
timer.run(this.virtual_machine);
}
}
Expand Down

0 comments on commit 46921ef

Please sign in to comment.