Repository navigation
Commit 4d103be
Unify signed timeouts across wait APIs (#9652)
* Reuse signed timeout conversion for channels and joins
Share native thread wait limits with the PyTime conversion helpers. Normalize channel and join timeouts with signed nanosecond precision, native index/float precedence, checked bounds, and timeout rounding. Preserve each API-specific None, negative, and nonblocking policy. Add generic conversion and boundary coverage without snippet tests.
Assisted-by: OpenAI Codex:model version not exposed
* Gate exported timeout bound to threading builds
Keep the shared microsecond limit available to channel waits, but compile the seconds-only _thread export when its threading consumer is enabled.
Assisted-by: OpenAI Codex:model version not exposed
* Reuse signed timeout conversion for lock acquisition
Bind raw lock arguments with FromArgs before callbacks, use Python truthiness and the shared PyTime conversion, and retain converted arguments throughout acquisition. Validate rounded sentinels and native timeout bounds rather than rounded-down public metadata. Add focused binding, conversion-order, and timeout policy tests.
Assisted-by: OpenAI Codex:model version not exposed
* Preserve integer daemon values in joinable thread audits
CPython builds this audit payload with OiO, so daemon is the normalized integer 0 or 1 rather than a bool. Keep the existing binding and audit-before-launch ordering.
Assisted-by: OpenAI Codex:model version not exposed
* Keep timeout tests focused on changed thread behavior
Drop three standalone tests of the unchanged shared time converter. Existing test_time covers its signed range and rounding; retain acquire conversion ordering, sentinel rounding, error precedence, and native wait-bound regressions.
Assisted-by: OpenAI Codex:model version not exposed
* Retire passing Linux thread audit expectation
The exact-head Linux CI and its test rerun both pass test_audit.test_threading. Preserve expected failure on other platforms until their results establish parity. Generated with scripts/update_lib helpers.
Assisted-by: OpenAI Codex:model version not exposed
* Retire the passing thread audit marker
Use scripts/update_lib auto-mark helpers with the exact-head hosted CI results to retire only observed unexpected-success markers. Test bodies, assertions, and platform skips remain unchanged.
Assisted-by: OpenAI Codex:model version not exposed
* Bound thread join waits without resetting the timeout
Cap each native condition-variable wait at the platform finite-wait limit and track elapsed time across chunks. Add a native boundary test for capped waits and deadline exhaustion.
Assisted-by: OpenAI Codex:model version not exposed
* Align select-family conversion and timeouts
Reuse signed pytime conversion and descriptor/argument binding across select, poll, epoll and kqueue. Preserve conversion order, argument roots, timeout bounds and rounding, and poll event masks. Use ppoll where supported for nanosecond deadlines.
Assisted-by: OpenAI Codex:model version not exposed
* Consume permits for nonblocking SimpleQueue get
Assisted-by: OpenAI Codex:model version not exposed
* Validate SimpleQueue timeouts without panicking
Assisted-by: OpenAI Codex:model version not exposed
* Use truth testing for SimpleQueue block arguments
Assisted-by: OpenAI Codex:model version not exposed
* Publish SimpleQueue items and permits together
Assisted-by: OpenAI Codex:model version not exposed
* Reuse shared signed time conversion in SimpleQueue
Use the same nanosecond conversion as thread and select APIs while preserving SimpleQueue ceiling rounding, nonblocking timeout bypass, negative checks, and checked deadline construction.
Assisted-by: OpenAI Codex:model version not exposed
* Rely on scope cleanup for redundant explicit drops
Keep retained owners outside lock scopes and preserve callback-sensitive release ordering.
Assisted-by: OpenAI Codex:model version not exposed
---------
Co-authored-by: Codex <[email protected]>
Co-authored-by: youknowdot <[email protected]>1 parent 34f4999 commit 4d103be
8 files changed
Lines changed: 739 additions & 350 deletions
File tree
- Lib/test
- crates
- host_env/src
- stdlib/src
- vm/src/stdlib
- time
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
294 | 307 | | |
295 | 308 | | |
296 | 309 | | |
| |||
482 | 495 | | |
483 | 496 | | |
484 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
485 | 575 | | |
486 | 576 | | |
487 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 89 | | |
98 | 90 | | |
99 | 91 | | |
| |||
167 | 159 | | |
168 | 160 | | |
169 | 161 | | |
170 | | - | |
171 | | - | |
172 | 162 | | |
173 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| |||
204 | 207 | | |
205 | 208 | | |
206 | 209 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 210 | + | |
| 211 | + | |
217 | 212 | | |
218 | 213 | | |
219 | 214 | | |
220 | 215 | | |
221 | 216 | | |
222 | 217 | | |
223 | | - | |
224 | | - | |
| 218 | + | |
| 219 | + | |
225 | 220 | | |
226 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
| |||
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
251 | | - | |
252 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
253 | 260 | | |
| 261 | + | |
254 | 262 | | |
255 | 263 | | |
256 | 264 | | |
| |||
261 | 269 | | |
262 | 270 | | |
263 | 271 | | |
| 272 | + | |
264 | 273 | | |
265 | 274 | | |
266 | | - | |
267 | | - | |
| 275 | + | |
| 276 | + | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| |||
274 | 283 | | |
275 | 284 | | |
276 | 285 | | |
277 | | - | |
278 | | - | |
279 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
280 | 301 | | |
281 | | - | |
282 | 302 | | |
283 | 303 | | |
284 | 304 | | |
285 | 305 | | |
286 | 306 | | |
287 | | - | |
| 307 | + | |
288 | 308 | | |
289 | 309 | | |
290 | 310 | | |
291 | 311 | | |
292 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
293 | 317 | | |
294 | 318 | | |
295 | 319 | | |
| |||
301 | 325 | | |
302 | 326 | | |
303 | 327 | | |
304 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
305 | 333 | | |
306 | 334 | | |
307 | 335 | | |
| |||
0 commit comments