[Python-Dev] Killing threads

Aahz Maruch aahz@rahul.net
Tue, 29 May 2001 08:47:13 -0700 (PDT)


Tim Peters wrote:
> 
> [Aahz]
> > Futz.  *Now* it works.  <sigh>
> 
> Now *what* works?  The test case I posted, or the original test case you
> tried (which you didn't post)?

My original test case.  I didn't actually preserve it, so the code below
was my attempt to reconstruct it (but I think it's pretty close to the
test case I tried).  Don't worry, if I run into this again, I'll be
*much* more careful about preserving the evidence and fiddling with
variations; last time I just assumed it was pilot error.

from threading import Thread
import os

class Foo(Thread):
    def run(self):
        while 1:
            pass

f = Foo()
f.start()
os._exit(1)