mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
_ => .
This commit is contained in:
@@ -145,7 +145,7 @@ const LinuxFutex = struct {
|
||||
|
||||
switch (linux.getErrno(linux.futex_wait(
|
||||
@ptrCast(*const i32, ptr),
|
||||
linux.FUTEX_PRIVATE_FLAG | linux.FUTEX_WAIT,
|
||||
linux.FUTEX.PRIVATE_FLAG | linux.FUTEX.WAIT,
|
||||
@bitCast(i32, expect),
|
||||
ts_ptr,
|
||||
))) {
|
||||
@@ -162,7 +162,7 @@ const LinuxFutex = struct {
|
||||
fn wake(ptr: *const Atomic(u32), num_waiters: u32) void {
|
||||
switch (linux.getErrno(linux.futex_wake(
|
||||
@ptrCast(*const i32, ptr),
|
||||
linux.FUTEX_PRIVATE_FLAG | linux.FUTEX_WAKE,
|
||||
linux.FUTEX.PRIVATE_FLAG | linux.FUTEX.WAKE,
|
||||
std.math.cast(i32, num_waiters) catch std.math.maxInt(i32),
|
||||
))) {
|
||||
.SUCCESS => {}, // successful wake up
|
||||
|
||||
@@ -119,7 +119,7 @@ pub fn run_for_ns(self: *IO, nanoseconds: u63) !void {
|
||||
// timeout below as an absolute value. Otherwise, we may deadlock if the clock sources are
|
||||
// dramatically different. Any kernel that supports io_uring will support CLOCK_MONOTONIC.
|
||||
var current_ts: timespec = undefined;
|
||||
os.clock_gettime(os.CLOCK_MONOTONIC, ¤t_ts) catch unreachable;
|
||||
os.clock_gettime(os.CLOCK.MONOTONIC, ¤t_ts) catch unreachable;
|
||||
// The absolute CLOCK_MONOTONIC time after which we may return from this function:
|
||||
const timeout_ts: timespec = .{
|
||||
.tv_sec = current_ts.tv_sec,
|
||||
|
||||
@@ -1186,7 +1186,7 @@ const Futex = switch (@import("builtin").os.tag) {
|
||||
fn wait(ptr: *const i32, cmp: i32) void {
|
||||
switch (system.getErrno(system.futex_wait(
|
||||
ptr,
|
||||
system.FUTEX_PRIVATE_FLAG | system.FUTEX_WAIT,
|
||||
system.FUTEX.PRIVATE_FLAG | system.FUTEX.WAIT,
|
||||
cmp,
|
||||
null,
|
||||
))) {
|
||||
@@ -1200,7 +1200,7 @@ const Futex = switch (@import("builtin").os.tag) {
|
||||
fn wake(ptr: *const i32) void {
|
||||
switch (system.getErrno(system.futex_wake(
|
||||
ptr,
|
||||
system.FUTEX_PRIVATE_FLAG | system.FUTEX_WAKE,
|
||||
system.FUTEX.PRIVATE_FLAG | system.FUTEX.WAKE,
|
||||
@as(i32, 1),
|
||||
))) {
|
||||
0 => {},
|
||||
|
||||
Reference in New Issue
Block a user