This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients benjamin.peterson, flavio, pitrou, vstinner
Date 2015-09-14.22:34:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442270090.16.0.868828822324.issue25084@psf.upfronthosting.co.za>
In-reply-to
Content
As you noticed, this issue was correctly fixed in Python 3 by using the C timed acquire methods of locks, instead of polling. The problem is that Python 2 supports a wide range of threading models:

Python/thread_atheos.h
Python/thread_beos.h
Python/thread_cthread.h
Python/thread_lwp.h
Python/thread_nt.h
Python/thread_os2.h
Python/thread_pth.h
Python/thread_pthread.h
Python/thread_sgi.h
Python/thread_solaris.h
Python/thread_wince.h

In Python 3, it was possible to use more features of OS threads because we dropped all implementations to only keep the 2 major implementations:

Python/thread_nt.h
Python/thread_pthread.h

Your change adds a new feature to threading.Lock in Python 2:

-.. method:: Lock.acquire([blocking])
+.. method:: Lock.acquire(blocking=True, timeout=-1)

But features cannot be added to Python 2 anymore!

The backport changes critical C code. There is a (high) risk of introducing a regression.

I suggest to close this issue as WONTFIX.

@Benjamin (Python 2.7 release manager): What do you think?

In 2015, it's time to upgrade to Python 3! https://docs.python.org/3/howto/pyporting.html
History
Date User Action Args
2015-09-14 22:34:50vstinnersetrecipients: + vstinner, pitrou, benjamin.peterson, flavio
2015-09-14 22:34:50vstinnersetmessageid: <1442270090.16.0.868828822324.issue25084@psf.upfronthosting.co.za>
2015-09-14 22:34:50vstinnerlinkissue25084 messages
2015-09-14 22:34:49vstinnercreate