authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-09-26 18:22:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-02 16:30:59-07:00
log96dc44b5eadd5104783c6cc8f60032e4221ca20a
tree2dfbbec931db0a6b3570d154a9f6fa24ed5745b8
parent79b807bf1c328af7bd7d27ef27dfd3938113ea40

std.Io: rename asyncConcurrent to concurrent


3 files changed, 11 insertions(+), 11 deletions(-)

lib/std/Io.zig+5-5
......@@ -583,7 +583,7 @@ pub const VTable = struct {
583583 start: *const fn (context: *const anyopaque, result: *anyopaque) void,
584584 ) ?*AnyFuture,
585585 /// Thread-safe.
586 asyncConcurrent: *const fn (
586 concurrent: *const fn (
587587 /// Corresponds to `Io.userdata`.
588588 userdata: ?*anyopaque,
589589 result_len: usize,
......@@ -1095,7 +1095,7 @@ pub fn Queue(Elem: type) type {
10951095/// not guaranteed to be available until `await` is called.
10961096///
10971097/// `function` *may* be called immediately, before `async` returns. This has
1098/// weaker guarantees than `asyncConcurrent`, making more portable and
1098/// weaker guarantees than `concurrent`, making more portable and
10991099/// reusable.
11001100///
11011101/// See also:
......@@ -1133,7 +1133,7 @@ pub fn async(
11331133/// This has stronger guarantee than `async`, placing restrictions on what kind
11341134/// of `Io` implementations are supported. By calling `async` instead, one
11351135/// allows, for example, stackful single-threaded blocking I/O.
1136pub fn asyncConcurrent(
1136pub fn concurrent(
11371137 io: Io,
11381138 function: anytype,
11391139 args: std.meta.ArgsTuple(@TypeOf(function)),
......@@ -1148,7 +1148,7 @@ pub fn asyncConcurrent(
11481148 }
11491149 };
11501150 var future: Future(Result) = undefined;
1151 future.any_future = try io.vtable.asyncConcurrent(
1151 future.any_future = try io.vtable.concurrent(
11521152 io.userdata,
11531153 @sizeOf(Result),
11541154 .of(Result),
......@@ -1166,7 +1166,7 @@ pub fn asyncConcurrent(
11661166///
11671167/// See also:
11681168/// * `async`
1169/// * `asyncConcurrent`
1169/// * `concurrent`
11701170pub fn asyncDetached(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void {
11711171 const Args = @TypeOf(args);
11721172 const TypeErased = struct {
lib/std/Io/EventLoop.zig+3-3
......@@ -139,7 +139,7 @@ pub fn io(el: *EventLoop) Io {
139139 .userdata = el,
140140 .vtable = &.{
141141 .async = async,
142 .asyncConcurrent = asyncConcurrent,
142 .concurrent = concurrent,
143143 .await = await,
144144 .asyncDetached = asyncDetached,
145145 .select = select,
......@@ -878,13 +878,13 @@ fn async(
878878 context_alignment: Alignment,
879879 start: *const fn (context: *const anyopaque, result: *anyopaque) void,
880880) ?*std.Io.AnyFuture {
881 return asyncConcurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch {
881 return concurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch {
882882 start(context.ptr, result.ptr);
883883 return null;
884884 };
885885}
886886
887fn asyncConcurrent(
887fn concurrent(
888888 userdata: ?*anyopaque,
889889 result_len: usize,
890890 result_alignment: Alignment,
lib/std/Io/Threaded.zig+3-3
......@@ -99,7 +99,7 @@ pub fn io(pool: *Pool) Io {
9999 .userdata = pool,
100100 .vtable = &.{
101101 .async = async,
102 .asyncConcurrent = asyncConcurrent,
102 .concurrent = concurrent,
103103 .await = await,
104104 .asyncDetached = asyncDetached,
105105 .cancel = cancel,
......@@ -261,7 +261,7 @@ fn async(
261261 }
262262 const pool: *Pool = @ptrCast(@alignCast(userdata));
263263 const cpu_count = pool.cpu_count catch {
264 return asyncConcurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch {
264 return concurrent(userdata, result.len, result_alignment, context, context_alignment, start) catch {
265265 start(context.ptr, result.ptr);
266266 return null;
267267 };
......@@ -325,7 +325,7 @@ fn async(
325325 return @ptrCast(closure);
326326}
327327
328fn asyncConcurrent(
328fn concurrent(
329329 userdata: ?*anyopaque,
330330 result_len: usize,
331331 result_alignment: std.mem.Alignment,