Skip to content

Commit 256f201

Browse files
committed
_queue: correct SIGNAL_CHECK_INTERVAL doc comment
The old comment claimed this mirrors CPython's PyThread_acquire_lock_timed, but CPython doesn't chunk its wait either -- it makes one sem_timedwait call and relies on the OS reporting EINTR. parking_lot's Condvar has no equivalent signal to surface, so polling is a workaround for that gap, not a mirror of CPython's approach. Assisted-by: Claude
1 parent 3409f2f commit 256f201

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

crates/stdlib/src/_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ mod _queue {
3131

3232
const INITIAL_RING_BUF_CAPACITY: usize = 8;
3333

34-
/// Wait chunk size so blocking waits stay responsive to signals, mirroring
35-
/// CPython's `PyThread_acquire_lock_timed`.
34+
/// `parking_lot`'s `Condvar` doesn't expose a mid-wait signal to us (unlike
35+
/// CPython's raw `sem_timedwait`, which reports `EINTR`), so we poll instead.
3636
#[cfg(feature = "threading")]
3737
const SIGNAL_CHECK_INTERVAL: Duration = Duration::from_millis(50);
3838

0 commit comments

Comments
 (0)