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.h | |
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.h')
-rw-r--r-- | x11vnc/util.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/x11vnc/util.h b/x11vnc/util.h index 2749e41..2136fe1 100644 --- a/x11vnc/util.h +++ b/x11vnc/util.h @@ -118,4 +118,23 @@ extern MUTEX(scrollMutex); #define SCR_UNLOCK if (use_threads) {UNLOCK(scrollMutex);} #define SCR_INIT INIT_MUTEX(scrollMutex) +#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD +MUTEX(clientMutex); +#endif +#define CLIENT_LOCK if (use_threads) {LOCK(clientMutex);} +#define CLIENT_UNLOCK if (use_threads) {UNLOCK(clientMutex);} +#define CLIENT_INIT INIT_MUTEX(clientMutex) + +/* + * The sendMutex member was added to libvncserver 0.9.8 + * rfb/rfb.h sets LIBVNCSERVER_SEND_MUTEX if present. + */ +#if LIBVNCSERVER_HAVE_LIBPTHREAD && defined(LIBVNCSERVER_SEND_MUTEX) +#define SEND_LOCK(cl) if (use_threads) LOCK((cl)->sendMutex); +#define SEND_UNLOCK(cl) if (use_threads) UNLOCK((cl)->sendMutex); +#else +#define SEND_LOCK(cl) +#define SEND_UNLOCK(cl) +#endif + #endif /* _X11VNC_UTIL_H */ |