def release_thread(self):
        """Release the current thread and run 'stop_thread' listeners."""
        thread_ident = _thread.get_ident()
        i = self.threads.pop(thread_ident, None)
        if i is not None:
            self.bus.publish('stop_thread', i)
Release the current thread and run 'stop_thread' listeners.
cherrypy/process/plugins.py