| ... | @@ -938,7 +938,7 @@ pub const VTable = struct { | ... | @@ -938,7 +938,7 @@ pub const VTable = struct { |
| 938 | /// up. This mode does not support results, await, or cancel. | 938 | /// up. This mode does not support results, await, or cancel. |
| 939 | /// | 939 | /// |
| 940 | /// Thread-safe. | 940 | /// Thread-safe. |
| 941 | go: *const fn ( | 941 | asyncDetached: *const fn ( |
| 942 | /// Corresponds to `Io.userdata`. | 942 | /// Corresponds to `Io.userdata`. |
| 943 | userdata: ?*anyopaque, | 943 | userdata: ?*anyopaque, |
| 944 | /// Copied and then passed to `start`. | 944 | /// Copied and then passed to `start`. |
| ... | @@ -1515,7 +1515,7 @@ pub fn async(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(functio | ... | @@ -1515,7 +1515,7 @@ pub fn async(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(functio |
| 1515 | | 1515 | |
| 1516 | /// Calls `function` with `args` asynchronously. The resource cleans itself up | 1516 | /// Calls `function` with `args` asynchronously. The resource cleans itself up |
| 1517 | /// when the function returns. Does not support await, cancel, or a return value. | 1517 | /// when the function returns. Does not support await, cancel, or a return value. |
| 1518 | pub fn go(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void { | 1518 | pub fn asyncDetached(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void { |
| 1519 | const Args = @TypeOf(args); | 1519 | const Args = @TypeOf(args); |
| 1520 | const TypeErased = struct { | 1520 | const TypeErased = struct { |
| 1521 | fn start(context: *const anyopaque) void { | 1521 | fn start(context: *const anyopaque) void { |
| ... | @@ -1523,7 +1523,7 @@ pub fn go(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function)) | ... | @@ -1523,7 +1523,7 @@ pub fn go(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function)) |
| 1523 | @call(.auto, function, args_casted.*); | 1523 | @call(.auto, function, args_casted.*); |
| 1524 | } | 1524 | } |
| 1525 | }; | 1525 | }; |
| 1526 | io.vtable.go(io.userdata, @ptrCast((&args)[0..1]), .of(Args), TypeErased.start); | 1526 | io.vtable.asyncDetached(io.userdata, @ptrCast((&args)[0..1]), .of(Args), TypeErased.start); |
| 1527 | } | 1527 | } |
| 1528 | | 1528 | |
| 1529 | pub fn now(io: Io, clockid: std.posix.clockid_t) ClockGetTimeError!Timestamp { | 1529 | pub fn now(io: Io, clockid: std.posix.clockid_t) ClockGetTimeError!Timestamp { |