glsl: switch to c11 mutex functions
authorBrian Paul <brianp@vmware.com>
Sat, 1 Mar 2014 17:21:07 +0000 (10:21 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Mar 2014 20:08:58 +0000 (13:08 -0700)
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/glsl/builtin_functions.cpp

index b9dc95902beb847d2b9c2875b77362b619c1bd54..a52077d06349d13e557d007b5d4dbc22f1ecea82 100644 (file)
@@ -4351,7 +4351,7 @@ builtin_builder::_memory_barrier(builtin_available_predicate avail)
 
 /* The singleton instance of builtin_builder. */
 static builtin_builder builtins;
-_glthread_DECLARE_STATIC_MUTEX(builtins_lock);
+static mtx_t builtins_lock = _MTX_INITIALIZER_NP;
 
 /**
  * External API (exposing the built-in module to the rest of the compiler):
@@ -4360,17 +4360,17 @@ _glthread_DECLARE_STATIC_MUTEX(builtins_lock);
 void
 _mesa_glsl_initialize_builtin_functions()
 {
-   _glthread_LOCK_MUTEX(builtins_lock);
+   mtx_lock(&builtins_lock);
    builtins.initialize();
-   _glthread_UNLOCK_MUTEX(builtins_lock);
+   mtx_unlock(&builtins_lock);
 }
 
 void
 _mesa_glsl_release_builtin_functions()
 {
-   _glthread_LOCK_MUTEX(builtins_lock);
+   mtx_lock(&builtins_lock);
    builtins.release();
-   _glthread_UNLOCK_MUTEX(builtins_lock);
+   mtx_unlock(&builtins_lock);
 }
 
 ir_function_signature *
@@ -4378,9 +4378,9 @@ _mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state,
                                  const char *name, exec_list *actual_parameters)
 {
    ir_function_signature * s;
-   _glthread_LOCK_MUTEX(builtins_lock);
+   mtx_lock(&builtins_lock);
    s = builtins.find(state, name, actual_parameters);
-   _glthread_UNLOCK_MUTEX(builtins_lock);
+   mtx_unlock(&builtins_lock);
    return s;
 }