This is pretty much the case. However, you do not need is_finished because you can use the join() method:
Monitor(threading.Thread): def run(self): resource = Resource("com1") self.alive = True try: while self.alive: pass
If you need to find if the thread is working, you can call mythread.is_alive() - you do not need to set this yourself.
Thomas K
source share