| ... | ... | @@ -13,11 +13,10 @@ const fmt = std.fmt; |
| 13 | 13 | const Allocator = std.mem.Allocator; |
| 14 | 14 | |
| 15 | 15 | /// Process-scoped map keeping track of all locked Cache hashes, to detect deadlocks. |
| 16 | | /// The plan is to enable this for debug builds only, but for now we enable |
| 17 | | /// it always to catch a deadlock. |
| 16 | /// This protection is conditionally compiled depending on `want_debug_deadlock`. |
| 18 | 17 | var all_cache_digest_set: std.AutoHashMapUnmanaged(BinDigest, void) = .{}; |
| 19 | 18 | var all_cache_digest_lock: std.Mutex = .{}; |
| 20 | | const want_debug_deadlock = true; // TODO change this for release builds |
| 19 | const want_debug_deadlock = std.debug.runtime_safety; |
| 21 | 20 | const DebugBinDigest = if (want_debug_deadlock) BinDigest else void; |
| 22 | 21 | const null_debug_bin_digest = if (want_debug_deadlock) ([1]u8{0} ** bin_digest_len) else {}; |
| 23 | 22 | |