This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients josh.r, kristjan.jonsson, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-03-22.01:57:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490147857.69.0.842736719254.issue29871@psf.upfronthosting.co.za>
In-reply-to
Content
Note: Beyond turning on the new primitives by default, I also made a change to PyCOND_TIMEDWAIT. The original code looked wrong, in that:

1. It assumed that when SleepConditionVariableSRW returned non-zero, you didn't know if the wait had timed out or not, so it returned 2 to indicate "Might have timed out, act as if it timed out"
2. It assumed that when SleepConditionVariableSRW returned zero, it had suffered a critical failure, and returned -1 to indicate that.

Neither of these things is true AFAICT. SleepConditionVariableSRW returns non-zero when it's alerted prior to timing out. Otherwise, it returns 0, and you have to check GetLastError to distinguish timeout from critical failures. Documentation is here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686304(v=vs.85).aspx

It's subject to "spurious" wake-ups, but so is pthread_cond_timedwait and the pthreads code doesn't use an "all timedwaits time out".
History
Date User Action Args
2017-03-22 01:57:37josh.rsetrecipients: + josh.r, paul.moore, kristjan.jonsson, tim.golden, zach.ware, steve.dower
2017-03-22 01:57:37josh.rsetmessageid: <1490147857.69.0.842736719254.issue29871@psf.upfronthosting.co.za>
2017-03-22 01:57:37josh.rlinkissue29871 messages
2017-03-22 01:57:36josh.rcreate