[cairo-commit] glitz/src/glx glitz_glx_info.c,1.2,1.3

David Reveman commit at pdx.freedesktop.org
Sat Mar 12 02:37:02 PST 2005


Committed by: davidr

Update of /cvs/cairo/glitz/src/glx
In directory gabe:/tmp/cvs-serv19091/src/glx

Modified Files:
	glitz_glx_info.c 
Log Message:
Fix non thread safe initialization code in GLX backend

Index: glitz_glx_info.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glx/glitz_glx_info.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- glitz_glx_info.c	25 Jan 2005 19:50:26 -0000	1.2
+++ glitz_glx_info.c	12 Mar 2005 10:37:00 -0000	1.3
@@ -256,15 +256,6 @@
 _glitz_glx_screen_destroy (glitz_glx_screen_info_t *screen_info);
 
 static void
-_glitz_glx_thread_info_init (glitz_glx_thread_info_t *thread_info)
-{
-  thread_info->displays = NULL;
-  thread_info->n_displays = 0;
-  thread_info->gl_library = NULL;
-  thread_info->dlhand = NULL;
-}
-
-static void
 _glitz_glx_thread_info_fini (glitz_glx_thread_info_t *thread_info)
 {
   int i;
@@ -298,6 +289,15 @@
 static xthread_key_t info_tsd;
 
 static void
+_glitz_glx_thread_info_init (glitz_glx_thread_info_t *thread_info)
+{
+  thread_info->displays = NULL;
+  thread_info->n_displays = 0;
+  thread_info->gl_library = NULL;
+  thread_info->dlhand = NULL;
+}
+
+static void
 _glitz_glx_thread_info_destroy (glitz_glx_thread_info_t *thread_info)
 {
   xthread_set_specific (info_tsd, NULL);
@@ -374,20 +374,20 @@
 }
 
 static glitz_glx_thread_info_t *
-_glitz_glx_thread_info_get (char *gl_library)
+_glitz_glx_thread_info_get (const char *gl_library)
 {
   if (gl_library) {
     int len = strlen (gl_library);
 
-    if (thread_info->gl_library) {
-      free (thread_info->gl_library);
-      thread_info->gl_library = NULL;
+    if (thread_info.gl_library) {
+      free (thread_info.gl_library);
+      thread_info.gl_library = NULL;
     }
     
-    thread_info->gl_library = malloc (len + 1);
-    if (thread_info->gl_library) {
-      memcpy (thread_info->gl_library, gl_library, len);
-      thread_info->gl_library[len] = '\0';
+    thread_info.gl_library = malloc (len + 1);
+    if (thread_info.gl_library) {
+      memcpy (thread_info.gl_library, gl_library, len);
+      thread_info.gl_library[len] = '\0';
     }
   }
   




More information about the cairo-commit mailing list