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 {...@@ -583,7 +583,7 @@ pub const VTable = struct {
583 start: *const fn (context: *const anyopaque, result: *anyopaque) void,583 start: *const fn (context: *const anyopaque, result: *anyopaque) void,
584 ) ?*AnyFuture,584 ) ?*AnyFuture,
585 /// Thread-safe.585 /// Thread-safe.
586 asyncConcurrent: *const fn (586 concurrent: *const fn (
587 /// Corresponds to `Io.userdata`.587 /// Corresponds to `Io.userdata`.
588 userdata: ?*anyopaque,588 userdata: ?*anyopaque,
589 result_len: usize,589 result_len: usize,
...@@ -1095,7 +1095,7 @@ pub fn Queue(Elem: type) type {...@@ -1095,7 +1095,7 @@ pub fn Queue(Elem: type) type {
1095/// not guaranteed to be available until `await` is called.1095/// not guaranteed to be available until `await` is called.
1096///1096///
1097/// `function` *may* be called immediately, before `async` returns. This has1097/// `function` *may* be called immediately, before `async` returns. This has
1098/// weaker guarantees than `asyncConcurrent`, making more portable and1098/// weaker guarantees than `concurrent`, making more portable and
1099/// reusable.1099/// reusable.
1100///1100///
1101/// See also:1101/// See also:
...@@ -1133,7 +1133,7 @@ pub fn async(...@@ -1133,7 +1133,7 @@ pub fn async(
1133/// This has stronger guarantee than `async`, placing restrictions on what kind1133/// This has stronger guarantee than `async`, placing restrictions on what kind
1134/// of `Io` implementations are supported. By calling `async` instead, one1134/// of `Io` implementations are supported. By calling `async` instead, one
1135/// allows, for example, stackful single-threaded blocking I/O.1135/// allows, for example, stackful single-threaded blocking I/O.
1136pub fn asyncConcurrent(1136pub fn concurrent(
1137 io: Io,1137 io: Io,
1138 function: anytype,1138 function: anytype,
1139 args: std.meta.ArgsTuple(@TypeOf(function)),1139 args: std.meta.ArgsTuple(@TypeOf(function)),
...@@ -1148,7 +1148,7 @@ pub fn asyncConcurrent(...@@ -1148,7 +1148,7 @@ pub fn asyncConcurrent(
1148 }1148 }
1149 };1149 };
1150 var future: Future(Result) = undefined;1150 var future: Future(Result) = undefined;
1151 future.any_future = try io.vtable.asyncConcurrent(1151 future.any_future = try io.vtable.concurrent(
1152 io.userdata,1152 io.userdata,
1153 @sizeOf(Result),1153 @sizeOf(Result),
1154 .of(Result),1154 .of(Result),
...@@ -1166,7 +1166,7 @@ pub fn asyncConcurrent(...@@ -1166,7 +1166,7 @@ pub fn asyncConcurrent(
1166///1166///
1167/// See also:1167/// See also:
1168/// * `async`1168/// * `async`
1169/// * `asyncConcurrent`1169/// * `concurrent`
1170pub fn asyncDetached(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void {1170pub fn asyncDetached(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) void {
1171 const Args = @TypeOf(args);1171 const Args = @TypeOf(args);
1172 const TypeErased = struct {1172 const TypeErased = struct {
lib/std/Io/EventLoop.zig+3-3
...@@ -139,7 +139,7 @@ pub fn io(el: *EventLoop) Io {...@@ -139,7 +139,7 @@ pub fn io(el: *EventLoop) Io {
139 .userdata = el,139 .userdata = el,
140 .vtable = &.{140 .vtable = &.{
141 .async = async,141 .async = async,
142 .asyncConcurrent = asyncConcurrent,142 .concurrent = concurrent,
143 .await = await,143 .await = await,
144 .asyncDetached = asyncDetached,144 .asyncDetached = asyncDetached,
145 .select = select,145 .select = select,
...@@ -878,13 +878,13 @@ fn async(...@@ -878,13 +878,13 @@ fn async(
878 context_alignment: Alignment,878 context_alignment: Alignment,
879 start: *const fn (context: *const anyopaque, result: *anyopaque) void,879 start: *const fn (context: *const anyopaque, result: *anyopaque) void,
880) ?*std.Io.AnyFuture {880) ?*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 {
882 start(context.ptr, result.ptr);882 start(context.ptr, result.ptr);
883 return null;883 return null;
884 };884 };
885}885}
886886
887fn asyncConcurrent(887fn concurrent(
888 userdata: ?*anyopaque,888 userdata: ?*anyopaque,
889 result_len: usize,889 result_len: usize,
890 result_alignment: Alignment,890 result_alignment: Alignment,
lib/std/Io/Threaded.zig+3-3
...@@ -99,7 +99,7 @@ pub fn io(pool: *Pool) Io {...@@ -99,7 +99,7 @@ pub fn io(pool: *Pool) Io {
99 .userdata = pool,99 .userdata = pool,
100 .vtable = &.{100 .vtable = &.{
101 .async = async,101 .async = async,
102 .asyncConcurrent = asyncConcurrent,102 .concurrent = concurrent,
103 .await = await,103 .await = await,
104 .asyncDetached = asyncDetached,104 .asyncDetached = asyncDetached,
105 .cancel = cancel,105 .cancel = cancel,
...@@ -261,7 +261,7 @@ fn async(...@@ -261,7 +261,7 @@ fn async(
261 }261 }
262 const pool: *Pool = @ptrCast(@alignCast(userdata));262 const pool: *Pool = @ptrCast(@alignCast(userdata));
263 const cpu_count = pool.cpu_count catch {263 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 {
265 start(context.ptr, result.ptr);265 start(context.ptr, result.ptr);
266 return null;266 return null;
267 };267 };
...@@ -325,7 +325,7 @@ fn async(...@@ -325,7 +325,7 @@ fn async(
325 return @ptrCast(closure);325 return @ptrCast(closure);
326}326}
327327
328fn asyncConcurrent(328fn concurrent(
329 userdata: ?*anyopaque,329 userdata: ?*anyopaque,
330 result_len: usize,330 result_len: usize,
331 result_alignment: std.mem.Alignment,331 result_alignment: std.mem.Alignment,