From: Alexander van Gessel Date: Tue, 24 Dec 2013 22:23:04 +0000 (+0100) Subject: Fix a deadlock X-Git-Tag: 2.5~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dac73a4bbc8e25631ee6d53fa96dc1d596fadc03;p=irker.git Fix a deadlock --- diff --git a/irkerd b/irkerd index f21f709..b0bec84 100755 --- a/irkerd +++ b/irkerd @@ -127,6 +127,7 @@ class IRCClient(): # Otherwise no other thread would ever be able to change # the shared state of an IRC object running this function. while True: + nextsleep = 0 with self.mutex: connected = [x for x in self.server_connections if x is not None and x.socket is not None] @@ -137,7 +138,8 @@ class IRCClient(): for s in insocks: connmap[s.fileno()].consume() else: - time.sleep(timeout) + nextsleep = timeout + time.sleep(nextsleep) def add_event_handler(self, event, handler): "Set a handler to be called later."