aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-12-19 20:15:50 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-12-23 22:15:11 -0800
commit77d2ad8c929680ed35fcfe6646f940518a07e7e4 (patch)
treef07cbefcc9b20049369188bfac27734a3c37c655 /lib/std/Thread.zig
parent50c585227ed2a57a4c1cf3f3b44914881999559d (diff)
downloadzig-77d2ad8c929680ed35fcfe6646f940518a07e7e4.tar.gz
zig-77d2ad8c929680ed35fcfe6646f940518a07e7e4.zip
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.
Diffstat (limited to 'lib/std/Thread.zig')
-rw-r--r--lib/std/Thread.zig3
1 files changed, 1 insertions, 2 deletions
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);