def stop(self): # Technically not thread-safe but close enough for now process_thread = self.process_thread self.process_thread = None if process_thread != None: process_thread.stop() process_thread.join(self.TIMEOUT) if process_thread.isAlive(): raise CF.Resource.StopError(CF.CF_NOTSET, "Processing thread did not die") Device.stop(self)
def stop(self): self.threadControlLock.acquire() try: process_thread = self.process_thread self.process_thread = None if process_thread != None: process_thread.stop() process_thread.join(self.TIMEOUT) if process_thread.isAlive(): raise CF.Resource.StopError(CF.CF_NOTSET, "Processing thread did not die") Device.stop(self) finally: self.threadControlLock.release()
def stop(self): Device.stop(self) if not ThreadedComponent.stopThread(self, self.TIMEOUT): raise CF.Resource.StopError(CF.CF_NOTSET, "Processing thread did not die")