diff options
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index c9502bda236..ed630bd0dd1 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1219,7 +1219,7 @@ create_textures(struct gl_context *ctx, GLenum target, /* * This must be atomic (generation and allocation of texture IDs) */ - mtx_lock(&ctx->Shared->Mutex); + _mesa_HashLockMutex(ctx->Shared->TexObjects); first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n); @@ -1229,18 +1229,18 @@ create_textures(struct gl_context *ctx, GLenum target, GLuint name = first + i; texObj = ctx->Driver.NewTextureObject(ctx, name, target); if (!texObj) { - mtx_unlock(&ctx->Shared->Mutex); + _mesa_HashUnlockMutex(ctx->Shared->TexObjects); _mesa_error(ctx, GL_OUT_OF_MEMORY, "gl%sTextures", caller); return; } /* insert into hash table */ - _mesa_HashInsert(ctx->Shared->TexObjects, texObj->Name, texObj); + _mesa_HashInsertLocked(ctx->Shared->TexObjects, texObj->Name, texObj); textures[i] = name; } - mtx_unlock(&ctx->Shared->Mutex); + _mesa_HashUnlockMutex(ctx->Shared->TexObjects); } /*@}*/ @@ -1489,9 +1489,7 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) /* The texture _name_ is now free for re-use. * Remove it from the hash table now. */ - mtx_lock(&ctx->Shared->Mutex); _mesa_HashRemove(ctx->Shared->TexObjects, delObj->Name); - mtx_unlock(&ctx->Shared->Mutex); /* Unreference the texobj. If refcount hits zero, the texture * will be deleted. @@ -1723,9 +1721,7 @@ _mesa_BindTexture( GLenum target, GLuint texName ) } /* and insert it into hash table */ - mtx_lock(&ctx->Shared->Mutex); _mesa_HashInsert(ctx->Shared->TexObjects, texName, newTexObj); - mtx_unlock(&ctx->Shared->Mutex); } } |