Issue #8844: Regular and recursive lock acquisitions can now be interrupted

by signals on platforms using pthreads.  Patch by Reid Kleckner.
This commit is contained in:
Antoine Pitrou 2010-12-15 22:59:16 +00:00
parent 119cda0fd2
commit 810023db3e
10 changed files with 298 additions and 71 deletions

View file

@ -137,6 +137,10 @@ Lock objects have the following methods:
.. versionchanged:: 3.2
The *timeout* parameter is new.
.. versionchanged:: 3.2
Lock acquires can now be interrupted by signals on POSIX.
.. method:: lock.release()
Releases the lock. The lock must have been acquired earlier, but not

View file

@ -408,6 +408,9 @@ All methods are executed atomically.
.. versionchanged:: 3.2
The *timeout* parameter is new.
.. versionchanged:: 3.2
Lock acquires can now be interrupted by signals on POSIX.
.. method:: Lock.release()

View file

@ -1212,6 +1212,12 @@ Multi-threading
* Similarly, :meth:`threading.Semaphore.acquire` also gained a *timeout*
argument. (Contributed by Torsten Landschoff; :issue:`850728`.)
* Regular and recursive lock acquisitions can now be interrupted by signals on
platforms using pthreads. This means that Python programs that deadlock while
acquiring locks can be successfully killed by repeatedly sending SIGINT to the
process (ie, by pressing Ctl+C in most shells).
(Contributed by Reid Kleckner; :issue:`8844`.)
Optimizations
=============