Fix green threads
authorLaurent Bachelier <laurent@bachelier.name>
Sat, 6 Oct 2012 18:10:54 +0000 (20:10 +0200)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 7 Oct 2012 01:20:08 +0000 (21:20 -0400)
Nothing would happen in green threads mode.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
irkerd

diff --git a/irkerd b/irkerd
index 0dd5835da97445a62edfa332ee77a2e6017cb463..d88d7e253f0a23c5f853d4ab3797e080b32614e9 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -521,8 +521,11 @@ if __name__ == '__main__':
             server.setDaemon(True)
             server.start()
         try:
-            while True:
-                time.sleep(10)
+            if green_threads:
+                while True:
+                    eventlet.sleep()
+            else:
+                signal.pause()
         except KeyboardInterrupt:
             raise SystemExit(1)
     except socket.error, e: