Mesa (master): mesa/hash: make the mtx non-recursive

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 1 19:35:11 UTC 2021


Module: Mesa
Branch: master
Commit: 0a78c22666e3c8e4dfaa5e59c7a1721be95ef9ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a78c22666e3c8e4dfaa5e59c7a1721be95ef9ce

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Wed Mar 10 11:59:24 2021 +0100

mesa/hash: make the mtx non-recursive

Now that no one is recursively locking it we can switch to
a plain mutex.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>

---

 src/mesa/main/hash.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c
index 9ad89b23f60..fd82114ec62 100644
--- a/src/mesa/main/hash.c
+++ b/src/mesa/main/hash.c
@@ -62,11 +62,7 @@ _mesa_NewHashTable(void)
       }
 
       _mesa_hash_table_set_deleted_key(table->ht, uint_key(DELETED_KEY_VALUE));
-      /*
-       * Needs to be recursive, since the callback in _mesa_HashWalk()
-       * is allowed to call _mesa_HashRemove().
-       */
-      mtx_init(&table->Mutex, mtx_recursive);
+      mtx_init(&table->Mutex, mtx_plain);
    }
    else {
       _mesa_error_no_memory(__func__);



More information about the mesa-commit mailing list