mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-29 18:41:40 +00:00
renderer/termio attach thread local state for crash capture
This commit is contained in:
@@ -15,6 +15,7 @@ const std = @import("std");
|
||||
const ArenaAllocator = std.heap.ArenaAllocator;
|
||||
const builtin = @import("builtin");
|
||||
const xev = @import("xev");
|
||||
const crash = @import("../crash/main.zig");
|
||||
const termio = @import("../termio.zig");
|
||||
const BlockingQueue = @import("../blocking_queue.zig").BlockingQueue;
|
||||
|
||||
@@ -200,6 +201,12 @@ pub fn threadMain(self: *Thread, io: *termio.Termio) void {
|
||||
fn threadMain_(self: *Thread, io: *termio.Termio) !void {
|
||||
defer log.debug("IO thread exited", .{});
|
||||
|
||||
// Setup our crash metadata
|
||||
crash.sentry.thread_state = .{
|
||||
.surface = io.surface_mailbox.surface,
|
||||
};
|
||||
defer crash.sentry.thread_state = null;
|
||||
|
||||
// Get the mailbox. This must be an SPSC mailbox for threading.
|
||||
const mailbox = switch (io.mailbox) {
|
||||
.spsc => |*v| v,
|
||||
|
||||
Reference in New Issue
Block a user