diff options
author | runge <runge@karlrunge.com> | 2009-05-21 10:57:03 -0400 |
---|---|---|
committer | runge <runge@karlrunge.com> | 2009-05-21 10:57:03 -0400 |
commit | 94d058b35f075cec2d6e8b6e37ee1a94086ea3f8 (patch) | |
tree | 6cec0620ab70b5db6b33645dbcac1071f3c7a556 /x11vnc/util.c | |
parent | 804335f9d296440bb708ca844f5d89b58b50b0c6 (diff) | |
download | libtdevnc-94d058b35f075cec2d6e8b6e37ee1a94086ea3f8.tar.gz libtdevnc-94d058b35f075cec2d6e8b6e37ee1a94086ea3f8.zip |
Thread safety. Fix -clip -in -rawfb. Try to avoid Xorg stuck
key bug.
Diffstat (limited to 'x11vnc/util.c')
-rw-r--r-- | x11vnc/util.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/x11vnc/util.c b/x11vnc/util.c index e7f7863..0a586f6 100644 --- a/x11vnc/util.c +++ b/x11vnc/util.c @@ -451,6 +451,9 @@ double rfac(void) { void check_allinput_rate(void) { static double last_all_input_check = 0.0; static int set = 0; + if (use_threads) { + return; + } if (! set) { set = 1; last_all_input_check = dnow(); @@ -482,6 +485,9 @@ static void do_allinput(long usec) { if (!screen || !screen->clientHead) { return; } + if (use_threads) { + return; + } if (usec < 0) { usec = 0; } @@ -592,9 +598,6 @@ void rfbCFD(long usec) { (int) usec, tm - x11vnc_start); } -#if 0 -fprintf(stderr, "handleEventsEagerly: %d\n", screen->handleEventsEagerly); -#endif if (! use_threads) { if (all_input) { @@ -678,6 +681,7 @@ char *choose_title(char *display) { } } strncat(title, display, MAXN - strlen(title)); + X_LOCK; if (subwin && dpy && valid_window(subwin, NULL, 0)) { #if !NO_X11 char *name = NULL; @@ -690,5 +694,6 @@ char *choose_title(char *display) { } #endif /* NO_X11 */ } + X_UNLOCK; return title; } |