| ... | @@ -281,8 +281,10 @@ pub const sys_can_stack_trace = switch (builtin.cpu.arch) { | ... | @@ -281,8 +281,10 @@ pub const sys_can_stack_trace = switch (builtin.cpu.arch) { |
| 281 | /// application's chosen `Io` implementation. | 281 | /// application's chosen `Io` implementation. |
| 282 | pub fn lockStderr(buffer: []u8) Io.LockedStderr { | 282 | pub fn lockStderr(buffer: []u8) Io.LockedStderr { |
| 283 | const io = std.options.debug_io; | 283 | const io = std.options.debug_io; |
| | 284 | const prev = io.swapCancelProtection(.blocked); |
| | 285 | defer _ = io.swapCancelProtection(prev); |
| 284 | return io.lockStderr(buffer, null) catch |err| switch (err) { | 286 | return io.lockStderr(buffer, null) catch |err| switch (err) { |
| 285 | error.Canceled => io.recancel(), | 287 | error.Canceled => unreachable, // Cancel protection enabled above. |
| 286 | }; | 288 | }; |
| 287 | } | 289 | } |
| 288 | | 290 | |