termio: set crash threadlocal data for exec reader thread

This commit is contained in:
Mitchell Hashimoto
2024-09-03 14:30:53 -07:00
parent f45cde0b95
commit f0c4afdf9c

View File

@ -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) {