From 02692ad78cbdc1086abc4e37739e512c9203f486 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Fri, 10 Jan 2025 03:24:44 -0500 Subject: cbe: fix miscomps of the compiler --- src/Compilation.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 241386f10c..7ec0640256 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -251,7 +251,12 @@ reference_trace: ?u32 = null, libcxx_abi_version: libcxx.AbiVersion = libcxx.AbiVersion.default, /// This mutex guards all `Compilation` mutable state. -mutex: std.Thread.Mutex = .{}, +/// Disabled in single-threaded mode because the thread pool spawns in the same thread. +mutex: if (builtin.single_threaded) struct { + pub inline fn tryLock(_: @This()) void {} + pub inline fn lock(_: @This()) void {} + pub inline fn unlock(_: @This()) void {} +} else std.Thread.Mutex = .{}, test_filters: []const []const u8, test_name_prefix: ?[]const u8, -- cgit v1.2.3