Commit aae85a4130

Andrew Kelley <andrew@ziglang.org>
2025-11-21 18:08:37
std.Io.Threaded: allow calling init in single-threaded mode
1 parent b4ec789
Changed files (1)
lib
lib/std/Io/Threaded.zig
@@ -103,7 +103,7 @@ pub fn init(
     /// here.
     gpa: Allocator,
 ) Threaded {
-    assert(!builtin.single_threaded); // use 'init_single_threaded' instead
+    if (builtin.single_threaded) return .init_single_threaded;
 
     var t: Threaded = .{
         .allocator = gpa,