Message95192
Here is a patch which adds a timeout feature to the locking operations
provided by Python. This feature is added at two levels:
- the C API level, with a new function PyThread_acquire_lock_timed()
- the Python level, with an optional `timeout` argument to the acquire()
method of Lock and RLock objects (it also helps simplify the wait()
function of Condition objects)
The timeout duration is expressed in microseconds at the C API level,
and in seconds at the Python API level. There is also a new Python-level
constant, `_thread.TIMEOUT_MAX`, indicating the max allowable timeout
value (values above this raise an OverflowError).
At the C level, the max timeout is PY_TIMEOUT_MAX (in microseconds). The
caller should check the value him/herself.
The patch contains both a POSIX implementation and a Windows
implementation. It still lacks docs. |
|
Date |
User |
Action |
Args |
2009-11-13 17:31:48 | pitrou | set | recipients:
+ pitrou, gps |
2009-11-13 17:31:48 | pitrou | set | messageid: <1258133508.5.0.728130823639.issue7316@psf.upfronthosting.co.za> |
2009-11-13 17:31:47 | pitrou | link | issue7316 messages |
2009-11-13 17:31:46 | pitrou | create | |
|