mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.Io.Threaded: fix the cancellation race
Now, before a syscall is entered, beginSyscall is called, which may return error.Canceled. After syscall returns, whether error or success, endSyscall is called. If the syscall returns EINTR then checkCancel is called. `cancelRequested` is removed from the std.Io VTable for now, with plans to replace it with a more powerful API that allows protection against cancellation requests. closes #25751
This commit is contained in:
parent
95f93a0b28
commit
29e418cbfb
2 changed files with 1956 additions and 1160 deletions
|
|
@ -620,11 +620,6 @@ pub const VTable = struct {
|
||||||
result: []u8,
|
result: []u8,
|
||||||
result_alignment: std.mem.Alignment,
|
result_alignment: std.mem.Alignment,
|
||||||
) void,
|
) void,
|
||||||
/// Returns whether the current thread of execution is known to have
|
|
||||||
/// been requested to cancel.
|
|
||||||
///
|
|
||||||
/// Thread-safe.
|
|
||||||
cancelRequested: *const fn (?*anyopaque) bool,
|
|
||||||
|
|
||||||
/// When this function returns, implementation guarantees that `start` has
|
/// When this function returns, implementation guarantees that `start` has
|
||||||
/// either already been called, or a unit of concurrency has been assigned
|
/// either already been called, or a unit of concurrency has been assigned
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue