std.json.Value: added dumpStream(), utilize WriteStream for dump()

This commit is contained in:
Sebastian Keller
2019-10-28 21:33:40 +01:00
committed by Andrew Kelley
parent ac6f0d245d
commit f81f36e2ff
3 changed files with 32 additions and 103 deletions

View File

@@ -45,6 +45,7 @@ var stderr_file_out_stream: File.OutStream = undefined;
var stderr_stream: ?*io.OutStream(File.WriteError) = null;
var stderr_mutex = std.Mutex.init();
pub fn warn(comptime fmt: []const u8, args: ...) void {
const held = stderr_mutex.acquire();
defer held.release();
@@ -64,6 +65,10 @@ pub fn getStderrStream() !*io.OutStream(File.WriteError) {
}
}
pub fn getStderrMutex() *std.Mutex {
return &stderr_mutex;
}
/// TODO multithreaded awareness
var self_debug_info: ?DebugInfo = null;