Browse Source

Merge pull request #266 from veyon/fix-tls

LibVNCServer: properly use thread-local storage
pull/3/head
Christian Beier 4 years ago committed by GitHub
parent
commit
2c61a095c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      libvncserver/tight.c
  2. 7
      libvncserver/zlib.c

7
libvncserver/tight.c

@ -57,10 +57,11 @@
* that we resort to using thread local storage instead of having
* per-client data.
*/
#if LIBVNCSERVER_HAVE_LIBPTHREAD && LIBVNCSERVER_HAVE_TLS && !defined(TLS) && defined(__linux__)
#if defined(__GNUC__)
#define TLS __thread
#endif
#ifndef TLS
#elif defined(_MSC_VER)
#define TLS __declspec(thread)
#else
#define TLS
#endif

7
libvncserver/zlib.c

@ -45,10 +45,11 @@
* tight. N.B. ZRLE does it the traditional way with per-client storage
* (and so at least ZRLE will work threaded on older systems.)
*/
#if LIBVNCSERVER_HAVE_LIBPTHREAD && LIBVNCSERVER_HAVE_TLS && !defined(TLS) && defined(__linux__)
#if defined(__GNUC__)
#define TLS __thread
#endif
#ifndef TLS
#elif defined(_MSC_VER)
#define TLS __declspec(thread)
#else
#define TLS
#endif

Loading…
Cancel
Save