Message289958
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". |
|
Date |
User |
Action |
Args |
2017-03-22 01:57:37 | josh.r | set | recipients:
+ josh.r, paul.moore, kristjan.jonsson, tim.golden, zach.ware, steve.dower |
2017-03-22 01:57:37 | josh.r | set | messageid: <1490147857.69.0.842736719254.issue29871@psf.upfronthosting.co.za> |
2017-03-22 01:57:37 | josh.r | link | issue29871 messages |
2017-03-22 01:57:36 | josh.r | create | |
|