aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-01-15 12:31:17 -0800
committerGitHub <noreply@github.com>2021-01-15 12:31:17 -0800
commit35686262f503372bb9f38a71b891fd19b30adecd (patch)
tree5e9d3af75fc0c3d89ee001e2c922946fabb7d6ac /lib/std/debug.zig
parent2faf8c53d226cec1445156cafdec59af5e909fb2 (diff)
parent19f893c6bbb3f5ab4e8d943b0ac2fefa94e5d666 (diff)
downloadzig-35686262f503372bb9f38a71b891fd19b30adecd.tar.gz
zig-35686262f503372bb9f38a71b891fd19b30adecd.zip
Merge pull request #7785 from ziglang/std-thread-primitives
organize std lib concurrency primitives and add RwLock
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 15d3baa1d0..e4ef25724b 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -50,7 +50,7 @@ pub const LineInfo = struct {
}
};
-var stderr_mutex = std.Mutex{};
+var stderr_mutex = std.Thread.Mutex{};
/// Deprecated. Use `std.log` functions for logging or `std.debug.print` for
/// "printf debugging".
@@ -65,7 +65,7 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {
nosuspend stderr.print(fmt, args) catch return;
}
-pub fn getStderrMutex() *std.Mutex {
+pub fn getStderrMutex() *std.Thread.Mutex {
return &stderr_mutex;
}
@@ -235,7 +235,7 @@ pub fn panic(comptime format: []const u8, args: anytype) noreturn {
var panicking: u8 = 0;
// Locked to avoid interleaving panic messages from multiple threads.
-var panic_mutex = std.Mutex{};
+var panic_mutex = std.Thread.Mutex{};
/// Counts how many times the panic handler is invoked by this thread.
/// This is used to catch and handle panics triggered by the panic handler.
@@ -280,7 +280,7 @@ pub fn panicExtra(trace: ?*const builtin.StackTrace, first_trace_addr: ?usize, c
// and call abort()
// Sleep forever without hammering the CPU
- var event: std.StaticResetEvent = .{};
+ var event: std.Thread.StaticResetEvent = .{};
event.wait();
unreachable;
}