aboutsummaryrefslogtreecommitdiff
path: root/std/debug
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-08-10 15:51:17 -0400
committerGitHub <noreply@github.com>2018-08-10 15:51:17 -0400
commitc4b9466da7592b95246909908619b68db5389ceb (patch)
tree6c55cc3ecb3e289fe2c13e346b70560fceaafbef /std/debug
parentd927f347de1f5a19545fc235f8779c2326409543 (diff)
parent598e80957e6eccc13ade72ce2693dcd60934763d (diff)
downloadzig-c4b9466da7592b95246909908619b68db5389ceb.tar.gz
zig-c4b9466da7592b95246909908619b68db5389ceb.zip
Merge pull request #1294 from ziglang/async-fs
introduce std.event.fs for async file system functions
Diffstat (limited to 'std/debug')
-rw-r--r--std/debug/index.zig9
1 files changed, 4 insertions, 5 deletions
diff --git a/std/debug/index.zig b/std/debug/index.zig
index ab50d79db3..f06da85f54 100644
--- a/std/debug/index.zig
+++ b/std/debug/index.zig
@@ -23,7 +23,10 @@ pub const runtime_safety = switch (builtin.mode) {
var stderr_file: os.File = undefined;
var stderr_file_out_stream: io.FileOutStream = undefined;
var stderr_stream: ?*io.OutStream(io.FileOutStream.Error) = null;
+var stderr_mutex = std.Mutex.init();
pub fn warn(comptime fmt: []const u8, args: ...) void {
+ const held = stderr_mutex.acquire();
+ defer held.release();
const stderr = getStderrStream() catch return;
stderr.print(fmt, args) catch return;
}
@@ -672,14 +675,10 @@ fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, comptime T: type
const ParseFormValueError = error{
EndOfStream,
- Io,
- BadFd,
- Unexpected,
InvalidDebugInfo,
EndOfFile,
- IsDir,
OutOfMemory,
-};
+} || std.os.File.ReadError;
fn parseFormValue(allocator: *mem.Allocator, in_stream: var, form_id: u64, is_64: bool) ParseFormValueError!FormValue {
return switch (form_id) {