(&self, n: u64)
| 241 | |
| 242 | #[inline] |
| 243 | fn decrement_thread_countdown(&self, n: u64) { |
| 244 | if n == 0 { |
| 245 | return; |
| 246 | } |
| 247 | let n = (n.min(i64::MAX as u64)) as i64; |
| 248 | let prev = self.thread_countdown.fetch_sub(n, Ordering::AcqRel); |
| 249 | if prev <= n { |
| 250 | // Clamp at 0 for safety in case of duplicate notifications. |
| 251 | self.thread_countdown.store(0, Ordering::Release); |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | /// Try to CAS detached threads directly to SUSPENDED and check whether |
| 256 | /// stop countdown reached zero after parking detached threads. |
no test coverage detected