summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2015-06-28 14:51:07 +0200
committerMatt Turner <mattst88@gmail.com>2015-06-29 09:06:40 -0700
commitde3e323be1bdc40a2a7d724d0f3db7a81a93bbbb (patch)
treea1611ce0309948d4e1edb1a24c42741b2cd9d2c2 /src/glsl
parent195ab79ddecbdbf1f1714c233df278bff46c13e8 (diff)
downloadexternal_mesa3d-de3e323be1bdc40a2a7d724d0f3db7a81a93bbbb.zip
external_mesa3d-de3e323be1bdc40a2a7d724d0f3db7a81a93bbbb.tar.gz
external_mesa3d-de3e323be1bdc40a2a7d724d0f3db7a81a93bbbb.tar.bz2
glsl: No need to lock in _mesa_glsl_release_types
This function only gets called while mesa is unloading, so there's no potential of racing or multiple calls at the same time. So let's just get rid of the locking. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/glsl_types.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index f675e90..c622380 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -324,8 +324,10 @@ const glsl_type *glsl_type::get_scalar_type() const
void
_mesa_glsl_release_types(void)
{
- mtx_lock(&glsl_type::mutex);
-
+ /* Should only be called during atexit (either when unloading shared
+ * object, or if process terminates), so no mutex-locking should be
+ * necessary.
+ */
if (glsl_type::array_types != NULL) {
hash_table_dtor(glsl_type::array_types);
glsl_type::array_types = NULL;
@@ -335,8 +337,6 @@ _mesa_glsl_release_types(void)
hash_table_dtor(glsl_type::record_types);
glsl_type::record_types = NULL;
}
-
- mtx_unlock(&glsl_type::mutex);
}