msg44957 - (view) |
Author: Dmitry Vasiliev (hdima) |
Date: 2003-11-28 12:47 |
New optional timeout parameter for Semaphore.acquire(). acquire(block=True, timeout=None) When invoked with blocking set to true and timeout set to a positive number, it blocks at most timeout seconds and return false if the internal counter is still zero; otherwise return true. |
|
|
msg44958 - (view) |
Author: Stephen Hansen (aptshansen) |
Date: 2007-03-16 07:08 |
This applies cleanly against the HEAD, and passes all of the threading tests. I don't see any reason NOT to have a timeout on the Semaphores, and the implementation is clean enough. I do think that it should have some tests written since its a newish feature before being accepted, though. |
|
|
msg99602 - (view) |
Author: Torsten Landschoff (torsten) * |
Date: 2010-02-19 23:46 |
I have been bitten by this omission from the python libs recently. I ended up copying the code from this diff into my script. I'd rather have this available with each python installation, so I updated the patch to include test cases as well as ReST documentation updates. Attached is the patch for Python 3.x (against current py3k). I'll send an updated patch for 2.7 as well. |
|
|
msg99605 - (view) |
Author: Torsten Landschoff (torsten) * |
Date: 2010-02-20 00:01 |
Here is the diff for Python 2.7 |
|
|
msg100031 - (view) |
Author: Torsten Landschoff (torsten) * |
Date: 2010-02-24 12:03 |
I just noticed that the multiprocessing module supports the timeout parameter of Semaphore. So the patch would also fix the documentation of multiprocessing.Semaphore since it refers to threading.Semaphore. |
|
|
msg100053 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-02-24 17:34 |
See for something more or less related. |
|
|
msg103227 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-04-15 16:05 |
2.7 is in (mostly) feature freeze mode, so I'm retargetting this to 3.2. (yes, this issue is very old; sorry) I will try to include it (or a variant thereof; the non-blocking + timeout combination doesn't make much sense, so I plan to forbid it) to the py3k branch soon. |
|
|
msg103457 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-04-17 23:53 |
Modified patch committed in r80157 (py3k). Thank you! |
|
|
msg120651 - (view) |
Author: Torsten Landschoff (torsten) * |
Date: 2010-11-06 22:11 |
Thanks for applying! |
|
|