Killing subservient threads

Christian Heimes lists at cheimes.de
Fri Feb 20 12:30:43 EST 2009


Gabriel Genellina wrote:
> 1) make the child window set a flag in the thread (let's say,
> t.terminate = True). And make the polling thread check the flag
> periodically (you possibly already have a loop there - just break the
> loop when you detect that self.terminate became true)

threading.Condition() and threading.Event() are especially designed for
the job. Please use them appropriately.

Christian




More information about the Python-list mailing list