From dac73a4bbc8e25631ee6d53fa96dc1d596fadc03 Mon Sep 17 00:00:00 2001 From: Alexander van Gessel Date: Tue, 24 Dec 2013 23:23:04 +0100 Subject: [PATCH] Fix a deadlock --- irkerd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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." -- 2.26.2