diff --git a/lib/std/Io.zig b/lib/std/Io.zig index 359d1a496f..7db4943a84 100644 --- a/lib/std/Io.zig +++ b/lib/std/Io.zig @@ -583,7 +583,7 @@ pub const VTable = struct { start: *const fn (context: *const anyopaque, result: *anyopaque) void, ) ?*AnyFuture, /// Thread-safe. - asyncConcurrent: *const fn ( + concurrent: *const fn ( /// Corresponds to `Io.userdata`. userdata: ?*anyopaque, result_len: usize, @@ -1095,7 +1095,7 @@ pub fn Queue(Elem: type) type { /// not guaranteed to be available until `await` is called. /// /// `function` *may* be called immediately, before `async` returns. This has -/// weaker guarantees than `asyncConcurrent`, making more portable and +/// weaker guarantees than `concurrent`, making more portable and /// reusable. /// /// See also: @@ -1133,7 +1133,7 @@ pub fn async( /// This has stronger guarantee than `async`, placing restrictions on what kind /// of `Io` implementations are supported. By calling `async` instead, one /// allows, for example, stackful single-threaded blocking I/O. -pub fn asyncConcurrent( +pub fn concurrent( io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function)), @@ -1148,7 +1148,7 @@ pub fn asyncConcurrent( } }; var future: Future(Result) = undefined; - future.any_future = try io.vtable.asyncConcurrent( + future.any_future = try io.vtable.concurrent( io.userdata, @sizeOf(Result), .of(Result), @@ -1166,7 +1166,7 @@ pub fn asyncConcurrent( /// /// See also: /// * `async` -/// * `asyncConcurrent` +/// * `concurrent` pub fn asyncDetached(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void { const Args = @TypeOf(args); const TypeErased = struct { diff --git a/lib/std/Io/EventLoop.zig b/lib/std/Io/EventLoop.zig index e24b6b445e..90f5dbdb22 100644 --- a/lib/std/Io/EventLoop.zig +++ b/lib/std/Io/EventLoop.zig @@ -139,7 +139,7 @@ pub fn io(el: *EventLoop) Io { .userdata = el, .vtable = &.{ .async = async, - .asyncConcurrent = asyncConcurrent, + .concurrent = concurrent, .await = await, .asyncDetached = asyncDetached, .select = select, @@ -878,13 +878,13 @@ fn async( context_alignment: Alignment, start: *const fn (context: *const anyopaque, result: *anyopaque) void, ) ?*std.Io.AnyFuture { - return asyncConcurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch { + return concurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch { start(context.ptr, result.ptr); return null; }; } -fn asyncConcurrent( +fn concurrent( userdata: ?*anyopaque, result_len: usize, result_alignment: Alignment, diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 07f87fdf0c..762eb81060 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -99,7 +99,7 @@ pub fn io(pool: *Pool) Io { .userdata = pool, .vtable = &.{ .async = async, - .asyncConcurrent = asyncConcurrent, + .concurrent = concurrent, .await = await, .asyncDetached = asyncDetached, .cancel = cancel, @@ -261,7 +261,7 @@ fn async( } const pool: *Pool = @ptrCast(@alignCast(userdata)); const cpu_count = pool.cpu_count catch { - return asyncConcurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch { + return concurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch { start(context.ptr, result.ptr); return null; }; @@ -325,7 +325,7 @@ fn async( return @ptrCast(closure); } -fn asyncConcurrent( +fn concurrent( userdata: ?*anyopaque, result_len: usize, result_alignment: std.mem.Alignment,