[issue8844] Condition.wait() doesn't raise KeyboardInterrupt

Reid Kleckner report at bugs.python.org
Sat Jul 10 17:47:47 CEST 2010


Reid Kleckner <rnk at mit.edu> added the comment:

Here's a patch that makes Python-level lock acquisitions interruptible for py3k.  There are many users of the C-level lock API, most of whom are not set up to deal with lock acquisition failure.  I decided to make a new API function and leave the others alone.

If possible, I think this should go out with 3.2.

In that case, I was wondering if I should merge PyThread_acquire_lock_timed with my new PyThread_acquire_lock_timed_intr, since PyThread_acquire_lock_timed wasn't available in 3.1.  Although it did go out in 2.7, we don't promise C API compatibility with the 2.x series, so I don't think it matters.

I've tested this patch on Mac OS X and Linux.  The whole test suite passes on both, along with the test that I added to test_threadsignals.py.

I added a noop compatibility wrapper to thread_nt.h, but I haven't tested it or built it.  When I get around to testing/fixing the subprocess patch on Windows, I'll make sure this works and the test is skipped.

----------
keywords: +patch
Added file: http://bugs.python.org/file17929/lock-interrupt.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8844>
_______________________________________


More information about the Python-bugs-list mailing list