diff options
author | David Reveman <davidr@novell.com> | 2005-03-12 10:37:00 +0000 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2005-03-12 10:37:00 +0000 |
commit | 188a9eee68590d629f98bd7decaf2bdc5a5950f4 (patch) | |
tree | bee12099e927c32bfa329c6fdca05783b2c0e31e /src | |
parent | 1c0dc7af78b321a0800d0319dba2659c1178b2ee (diff) |
Fix non thread safe initialization code in GLX backend
Diffstat (limited to 'src')
-rw-r--r-- | src/glx/glitz_glx_info.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/glx/glitz_glx_info.c b/src/glx/glitz_glx_info.c index 0e95e8d..c8e60d1 100644 --- a/src/glx/glitz_glx_info.c +++ b/src/glx/glitz_glx_info.c @@ -256,15 +256,6 @@ static void _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 int tsd_initialized = 0; 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 @@ _glitz_glx_thread_info_destroy (glitz_glx_thread_info_t *thread_info) } 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'; } } |