Mesa (master): mesa: Use a recursive mutex for the texture lock.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Aug 21 00:29:23 UTC 2014


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Aug 18 17:20:20 2014 -0700

mesa: Use a recursive mutex for the texture lock.

This avoids problems with things like meta operations calling functions
that want to take the lock while the lock is already held.  Basically,
the point is to guard against API reentrancy across threads...not to
guard against ourselves.

Dave Airlie opposed this change, but it makes master usable again and no
one proposed a better solution.  We can revert this if/when someone
does.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
Tested-by: Chris Forbes <chrisf at ijw.co.nz>

---

 src/mesa/main/shared.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 0189dd2..7ef932f 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -113,7 +113,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
    assert(shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount == 1);
 
    /* Mutex and timestamp for texobj state validation */
-   mtx_init(&shared->TexMutex, mtx_plain);
+   mtx_init(&shared->TexMutex, mtx_recursive);
    shared->TextureStateStamp = 0;
 
    shared->FrameBuffers = _mesa_NewHashTable();




More information about the mesa-commit mailing list