| ... | ... | @@ -39,7 +39,6 @@ cpu_count_error: ?std.Thread.CpuCountError, |
| 39 | 39 | busy_count: usize = 0, |
| 40 | 40 | worker_threads: std.atomic.Value(?*Thread), |
| 41 | 41 | pid: Pid = .unknown, |
| 42 | | robust_cancel: RobustCancel, |
| 43 | 42 | |
| 44 | 43 | wsa: if (is_windows) Wsa else struct {} = .{}, |
| 45 | 44 | |
| ... | ... | @@ -105,8 +104,6 @@ pub const Environ = struct { |
| 105 | 104 | }; |
| 106 | 105 | }; |
| 107 | 106 | |
| 108 | | pub const RobustCancel = enum { enabled, disabled }; |
| 109 | | |
| 110 | 107 | pub const Pid = if (native_os == .linux) enum(posix.pid_t) { |
| 111 | 108 | unknown = 0, |
| 112 | 109 | _, |
| ... | ... | @@ -315,7 +312,7 @@ const Group = struct { |
| 315 | 312 | var need_signal: bool = !skip_signals and g.cancelThreads(t); |
| 316 | 313 | var timeout_ns: u64 = 1 << 10; |
| 317 | 314 | while (true) { |
| 318 | | need_signal = need_signal and g.signalAllCanceledSyscalls(t) and t.robust_cancel == .enabled; |
| 315 | need_signal = need_signal and g.signalAllCanceledSyscalls(t); |
| 319 | 316 | Thread.futexWaitUncancelable(&num_completed.raw, 0, if (need_signal) timeout_ns else null); |
| 320 | 317 | switch (num_completed.load(.acquire)) { // acquire task results |
| 321 | 318 | 0 => {}, |
| ... | ... | @@ -469,7 +466,7 @@ const Future = struct { |
| 469 | 466 | var need_signal: bool = thread != null and thread.?.cancelAwaitable(.fromFuture(future)); |
| 470 | 467 | var timeout_ns: u64 = 1 << 10; |
| 471 | 468 | while (true) { |
| 472 | | need_signal = need_signal and thread.?.signalCanceledSyscall(t, .fromFuture(future)) and t.robust_cancel == .enabled; |
| 469 | need_signal = need_signal and thread.?.signalCanceledSyscall(t, .fromFuture(future)); |
| 473 | 470 | Thread.futexWaitUncancelable(&num_completed.raw, 0, if (need_signal) timeout_ns else null); |
| 474 | 471 | switch (num_completed.load(.acquire)) { // acquire task results |
| 475 | 472 | 0 => {}, |
| ... | ... | @@ -1112,17 +1109,6 @@ pub const InitOptions = struct { |
| 1112 | 1109 | /// concurrent tasks. After this number, calls to `Io.concurrent` return |
| 1113 | 1110 | /// `error.ConcurrencyUnavailable`. |
| 1114 | 1111 | concurrent_limit: Io.Limit = .unlimited, |
| 1115 | | /// When a cancel request is made, blocking syscalls can be unblocked by |
| 1116 | | /// issuing a signal. However, if the signal arrives after the check and before |
| 1117 | | /// the syscall instruction, it is missed. |
| 1118 | | /// |
| 1119 | | /// This option solves the race condition by retrying the signal delivery |
| 1120 | | /// until it is acknowledged, with an exponential backoff. |
| 1121 | | /// |
| 1122 | | /// Unfortunately, trying again until the cancellation request is acknowledged |
| 1123 | | /// has been observed to be relatively slow, and usually strong cancellation |
| 1124 | | /// guarantees are not needed, so this defaults to off. |
| 1125 | | robust_cancel: RobustCancel = .disabled, |
| 1126 | 1112 | /// Affects the following operations: |
| 1127 | 1113 | /// * `processExecutablePath` on OpenBSD and Haiku. |
| 1128 | 1114 | argv0: Argv0 = .{}, |
| ... | ... | @@ -1160,7 +1146,6 @@ pub fn init( |
| 1160 | 1146 | .have_signal_handler = false, |
| 1161 | 1147 | .argv0 = options.argv0, |
| 1162 | 1148 | .environ = options.environ, |
| 1163 | | .robust_cancel = options.robust_cancel, |
| 1164 | 1149 | .worker_threads = .init(null), |
| 1165 | 1150 | }; |
| 1166 | 1151 | |
| ... | ... | @@ -1195,7 +1180,6 @@ pub const init_single_threaded: Threaded = .{ |
| 1195 | 1180 | .old_sig_io = undefined, |
| 1196 | 1181 | .old_sig_pipe = undefined, |
| 1197 | 1182 | .have_signal_handler = false, |
| 1198 | | .robust_cancel = .disabled, |
| 1199 | 1183 | .argv0 = .{}, |
| 1200 | 1184 | .environ = .{}, |
| 1201 | 1185 | .worker_threads = .init(null), |