diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-10 15:51:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-10 15:51:17 -0400 |
| commit | c4b9466da7592b95246909908619b68db5389ceb (patch) | |
| tree | 6c55cc3ecb3e289fe2c13e346b70560fceaafbef /std/debug | |
| parent | d927f347de1f5a19545fc235f8779c2326409543 (diff) | |
| parent | 598e80957e6eccc13ade72ce2693dcd60934763d (diff) | |
| download | zig-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.zig | 9 |
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) { |
