Use await_notification instead of sleep(), gives us much better response time.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 17:01:01 +0000 (17:01 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 17:01:01 +0000 (17:01 +0000)
bigscreen/ccbs_bigscreen.cpp

index 435d06a..dfb025f 100644 (file)
@@ -45,7 +45,7 @@ void main_loop(pqxx::connection &conn)
 {
        if (active_tournament.id == -1) {
                // No active tournament, sleep a second or so and exit
-               sleep(1);
+               conn.await_notification(1, 0);
                return;
        }
 
@@ -58,7 +58,7 @@ void main_loop(pqxx::connection &conn)
        memcpy(framebuf, screenbuf, 800*600*4);
 
        ptc_update(framebuf);
-       sleep(1);
+       conn.await_notification(0, 50000);
 }
 
 int main(int argc, char **argv)