diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2006-12-05 08:03:18 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2006-12-05 08:03:18 +0000 |
commit | 813dbb430d6758ff21ebeaa9b04905c1cfc432b3 (patch) | |
tree | 331309f076306323636dbcf4f37516e6b537208f /unix/x0vncserver/x0vncserver.cxx | |
parent | 4b9bf90584a608450e8cefb2223b4d4895d6bd4e (diff) | |
download | tigervnc-813dbb430d6758ff21ebeaa9b04905c1cfc432b3.tar.gz tigervnc-813dbb430d6758ff21ebeaa9b04905c1cfc432b3.zip |
Fixed unreasonably high CPU utilization in cases when new connection has
been accepted but polling was not activated yet.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2182 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/x0vncserver.cxx')
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 48be662e..78e1cc05 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -513,7 +513,10 @@ int main(int argc, char** argv) } } - if (clients_connected) { + if (!clients_connected) + sched.reset(); + + if (sched.isRunning()) { int wait_ms = sched.millisRemaining(); if (wait_ms > 500) { wait_ms = 500; @@ -523,7 +526,6 @@ int main(int argc, char** argv) // fprintf(stderr, "[%d]\t", wait_ms); #endif } else { - sched.reset(); tv.tv_usec = 100000; } tv.tv_sec = 0; |