Reid Kleckner <r...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue8844>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to