From f0c4afdf9cea34d7b15cbb18736a3bad840cc929 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 3 Sep 2024 14:30:53 -0700 Subject: [PATCH] termio: set crash threadlocal data for exec reader thread --- src/termio/Exec.zig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 55d47defa..f5c0c3326 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -12,6 +12,7 @@ const posix = std.posix; const xev = @import("xev"); const build_config = @import("../build_config.zig"); const configpkg = @import("../config.zig"); +const crash = @import("../crash/main.zig"); const fastmem = @import("../fastmem.zig"); const internal_os = @import("../os/main.zig"); const renderer = @import("../renderer.zig"); @@ -1184,6 +1185,13 @@ pub const ReadThread = struct { // Always close our end of the pipe when we exit. defer posix.close(quit); + // Setup our crash metadata + crash.sentry.thread_state = .{ + .type = .io, + .surface = io.surface_mailbox.surface, + }; + defer crash.sentry.thread_state = null; + // First thing, we want to set the fd to non-blocking. We do this // so that we can try to read from the fd in a tight loop and only // check the quit fd occasionally. @@ -1265,6 +1273,13 @@ pub const ReadThread = struct { // Always close our end of the pipe when we exit. defer posix.close(quit); + // Setup our crash metadata + crash.sentry.thread_state = .{ + .type = .io, + .surface = io.surface_mailbox.surface, + }; + defer crash.sentry.thread_state = null; + var buf: [1024]u8 = undefined; while (true) { while (true) {