def stop(self):
        """Stop our callback's background task thread."""
        if self.thread is None:
            self.bus.log(
                'No thread running for %s.' % self.name
                or self.__class__.__name__,
            )
        else:
            if self.thread is not threading.current_thread():
                name = self.thread.name
                self.thread.cancel()
                if not self.thread.daemon:
                    self.bus.log('Joining %r' % name)
                    self.thread.join()
                self.bus.log('Stopped thread %r.' % name)
            self.thread = None
Stop our callback's background task thread.
cherrypy/process/plugins.py