[New-bugs-announce] [issue10978] Add optional argument to Semaphore.release for releasing multiple threads
report at bugs.python.org
Sat Jan 22 01:15:36 CET 2011
New submission from Raymond Hettinger <rhettinger at users.sourceforge.net>:
Call sem.release(5) would have the same effect as:
for i in range(5):
The use case is when a single semaphore is holding up multiple threads and needs to release them all. According to "The Little Book of Semaphores <http://greenteapress.com/semaphores/>", this is a common design pattern.
Basic patch attached. If the proposal meets with acceptance, will add tests and a doc update.
components: Library (Lib)
title: Add optional argument to Semaphore.release for releasing multiple threads
versions: Python 3.3
Added file: http://bugs.python.org/file20483/sem.diff
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce