| Store | Cart

Bug in threading.Thread.join() ?

From: Peter Hansen <pet...@engcorp.com>
Sat, 26 Mar 2005 07:14:43 -0500
Tim Peters wrote:
> [Peter Hansen]>>If you hit Ctrl-C while the join's wait() is occurring,>>you'll raise a KeyboardInterrupt and bypass the>>release() call.> Then you're doing something other than what you described.  Here on> WinXP SP2 w/ Python 2.4c2:
[snip]
> I can hit Ctrl+C all day at this point, and nothing (visible) happens.>  That's because it's sitting in self.__block.wait(), which is in turn> sitting in waiter.acquire(), and it's simply not possible for Ctrl+C> to interrupt a mutex acquire.> > As above, I don't know what you're doing.  Maybe you're doing a join()> with a timeout too?  In that case, I doubt anyone gave any thought to> what happens if you muck with KeyboardInterrupt too.

Yes, definitely doing this with a timeout value on the join().
Changing your example to do that (join(5), say) pretty
much demonstrates the trouble... in this case a traceback
for KeyboardInterrupt is printed, but the program does not
terminate because of the thread stuck at the __stop()'s
__acquire().

I'll take your last sentence as a form of blessing to go
file a bug report, unless you don't think that's a good idea.

Thanks, Tim!

-Peter

Recent Messages in this Thread
Peter Hansen Mar 24, 2005 05:32 pm
Tim Peters Mar 26, 2005 05:33 am
Peter Hansen Mar 26, 2005 12:14 pm
Peter Hansen Mar 26, 2005 02:48 pm
Messages in this thread