From 77d2ad8c929680ed35fcfe6646f940518a07e7e4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 19 Dec 2025 20:15:50 -0800 Subject: std: consolidate all instances of std.Io.Threaded into a singleton It's better to avoid references to this global variable, but, in the cases where it's needed, such as in std.debug.print and collecting stack traces, better to share the same instance. --- lib/std/Thread.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/std/Thread.zig') diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index fbce1cd000..f25c664000 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -322,8 +322,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co var buf: [32]u8 = undefined; const path = try std.fmt.bufPrint(&buf, "/proc/self/task/{d}/comm", .{self.getHandle()}); - var threaded: std.Io.Threaded = .init_single_threaded; - const io = threaded.ioBasic(); + const io = Io.Threaded.global_single_threaded.ioBasic(); const file = try Io.Dir.cwd().openFile(io, path, .{}); defer file.close(io); -- cgit v1.2.3