def stop(self):
self.running = False<EOL>try:<EOL><INDENT>self.commands_thread.kill()<EOL><DEDENT>except:  <EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>self.lock.set()<EOL>if self.config["<STR_LIT>"]:<EOL><INDENT>self.log("<STR_LIT>")<EOL><DEDENT>for module in self.modules.values():<EOL><INDENT>module.kill()<EOL><DEDENT><DEDENT>except:  <EOL><INDENT>pass<EOL><DEDENT>
Set the Event lock, this will break all threads' loops.