[cairo] Additional option for pixman library configuration in single-thread environment

Soeren Sandmann sandmann at daimi.au.dk
Mon Apr 19 03:34:19 PDT 2010


Vsevolod Novikov <nnseva at mail.ru> writes:

> Hi,
> 
> I would like to use the cairo library in the Airplay SDK environment (www.airplaysdk.com). The SDK environment is now single-thread, so I don't need to have thread-specific data (TLS option). Moreover, thread-aware code in the pixman library causes compilation and/or run-time problems.
> 
> It would be useful to have a configuration option to switch using
> TLS off at all for pixman library in such environment, as it is made
> in applied patch (the similar code in the cairo library is present,
> but undocumented. I am using CAIRO_NO_MUTEX for the purpose).

It's probably reasonable to do this given that cairo has the
corresponding feature, but I'd prefer to have to #error in
pixman-compiler.h extended to say something similar to the one in
cairo: That you can defined PIXMAN_NO_TLS, but pixman won't work with
multiple threads.


Thanks,
Soren


The patch, for reference:

--- pixman-compiler.h.orig	2010-04-18 14:40:03.000000000 +0400
+++ pixman-compiler.h	2010-04-18 14:40:03.000000000 +0400
@@ -70,7 +70,14 @@
 #endif
 
 /* TLS */
-#if defined(TOOLCHAIN_SUPPORTS__THREAD)
+#if defined(PIXMAN_NO_TLS)
+
+#   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
+    static type name
+#   define PIXMAN_GET_THREAD_LOCAL(name)				\
+    (&name)
+
+#elif defined(TOOLCHAIN_SUPPORTS__THREAD)
 
 #   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
     static __thread type name


More information about the cairo mailing list