| author | |
| committer | |
| log | 806214797a124b175a2318cf25f487970f4518a4 |
| tree | b50a67e79947d8b226a4f4c2f556a898d485afc5 |
| parent | 9a62dc4d89e0874d3f5d2bebee11d57bdce8b0d5 |
it's a better name because it's more descriptive, not a reference, and
hints that it is less common than async3 files changed, 7 insertions(+), 7 deletions(-)
lib/std/Io.zig+3-3| ... | ... | @@ -585,7 +585,7 @@ pub const VTable = struct { |
| 585 | 585 | /// up. This mode does not support results, await, or cancel. |
| 586 | 586 | /// |
| 587 | 587 | /// Thread-safe. |
| 588 | go: *const fn ( | |
| 588 | asyncDetached: *const fn ( | |
| 589 | 589 | /// Corresponds to `Io.userdata`. |
| 590 | 590 | userdata: ?*anyopaque, |
| 591 | 591 | /// Copied and then passed to `start`. |
| ... | ... | @@ -1162,7 +1162,7 @@ pub fn async(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(functio |
| 1162 | 1162 | |
| 1163 | 1163 | /// Calls `function` with `args` asynchronously. The resource cleans itself up |
| 1164 | 1164 | /// when the function returns. Does not support await, cancel, or a return value. |
| 1165 | pub fn go(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void { | |
| 1165 | pub fn asyncDetached(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void { | |
| 1166 | 1166 | const Args = @TypeOf(args); |
| 1167 | 1167 | const TypeErased = struct { |
| 1168 | 1168 | fn start(context: *const anyopaque) void { |
| ... | ... | @@ -1170,7 +1170,7 @@ pub fn go(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function)) |
| 1170 | 1170 | @call(.auto, function, args_casted.*); |
| 1171 | 1171 | } |
| 1172 | 1172 | }; |
| 1173 | io.vtable.go(io.userdata, @ptrCast((&args)[0..1]), .of(Args), TypeErased.start); | |
| 1173 | io.vtable.asyncDetached(io.userdata, @ptrCast((&args)[0..1]), .of(Args), TypeErased.start); | |
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | 1176 | pub fn now(io: Io, clockid: std.posix.clockid_t) ClockGetTimeError!Timestamp { |
lib/std/Io/EventLoop.zig+2-2| ... | ... | @@ -140,7 +140,7 @@ pub fn io(el: *EventLoop) Io { |
| 140 | 140 | .vtable = &.{ |
| 141 | 141 | .async = async, |
| 142 | 142 | .await = await, |
| 143 | .go = go, | |
| 143 | .asyncDetached = asyncDetached, | |
| 144 | 144 | .select = select, |
| 145 | 145 | .cancel = cancel, |
| 146 | 146 | .cancelRequested = cancelRequested, |
| ... | ... | @@ -776,7 +776,7 @@ const DetachedClosure = struct { |
| 776 | 776 | } |
| 777 | 777 | }; |
| 778 | 778 | |
| 779 | fn go( | |
| 779 | fn asyncDetached( | |
| 780 | 780 | userdata: ?*anyopaque, |
| 781 | 781 | context: []const u8, |
| 782 | 782 | context_alignment: std.mem.Alignment, |
lib/std/Io/ThreadPool.zig+2-2| ... | ... | @@ -332,7 +332,7 @@ pub fn io(pool: *Pool) Io { |
| 332 | 332 | .vtable = &.{ |
| 333 | 333 | .async = async, |
| 334 | 334 | .await = await, |
| 335 | .go = go, | |
| 335 | .asyncDetached = asyncDetached, | |
| 336 | 336 | .cancel = cancel, |
| 337 | 337 | .cancelRequested = cancelRequested, |
| 338 | 338 | .select = select, |
| ... | ... | @@ -521,7 +521,7 @@ const DetachedClosure = struct { |
| 521 | 521 | } |
| 522 | 522 | }; |
| 523 | 523 | |
| 524 | fn go( | |
| 524 | fn asyncDetached( | |
| 525 | 525 | userdata: ?*anyopaque, |
| 526 | 526 | context: []const u8, |
| 527 | 527 | context_alignment: std.mem.Alignment, |