Skip to content

Commit 0aa71f3

Browse files
committed
Make std.Thread.use_pthreads return false in single-threaded builds
1 parent 09a5954 commit 0aa71f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/Thread.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub const RwLock = @import("Thread/RwLock.zig");
2020
pub const Pool = @import("Thread/Pool.zig");
2121
pub const WaitGroup = @import("Thread/WaitGroup.zig");
2222

23-
pub const use_pthreads = native_os != .windows and native_os != .wasi and builtin.link_libc;
23+
pub const use_pthreads = native_os != .windows and native_os != .wasi and builtin.link_libc and !builtin.single_threaded;
2424

2525
/// A thread-safe logical boolean value which can be `set` and `unset`.
2626
///

0 commit comments

Comments
 (0)