cpython: 78a38f8bd5d9 (original) (raw)

Mercurial > cpython

changeset 92269:78a38f8bd5d9

Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait() caused by mutation of the waiters queue without holding the lock. Patch by Doug Zongker. [#22185]

Antoine Pitrou solipsis@pitrou.net
date Fri, 29 Aug 2014 23:27:33 +0200
parents ab81b4cdc33c(current diff)4cce39cfe46c(diff)
children c499cc2c4a06
files Lib/threading.py Misc/ACKS Misc/NEWS
diffstat 3 files changed, 11 insertions(+), 5 deletions(-)[+] [-] Lib/threading.py 11 Misc/ACKS 1 Misc/NEWS 4

line wrap: on

line diff

--- a/Lib/threading.py +++ b/Lib/threading.py @@ -290,6 +290,7 @@ class Condition: waiter.acquire() self._waiters.append(waiter) saved_state = self._release_save()

@@ -299,14 +300,14 @@ class Condition: gotit = waiter.acquire(True, timeout) else: gotit = waiter.acquire(False)

def wait_for(self, predicate, timeout=None): """Wait until a condition evaluates to True.

--- a/Misc/ACKS +++ b/Misc/ACKS @@ -1518,4 +1518,5 @@ Cheng Zhang Kai Zhu Tarek Ziadé Gennadiy Zlobin +Doug Zongker Peter Åstrand

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -124,6 +124,10 @@ Core and Builtins Library ------- +- Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait()