diff options
author | Brian Paul <[email protected]> | 2000-03-21 17:42:27 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-03-21 17:42:27 +0000 |
commit | 832179c50e2cf5de9735241e4767aea4d6fc33bf (patch) | |
tree | 7f265a594dcaa0bb05258067852d9615330c2fbc /src/mesa/main/texobj.c | |
parent | fd2e6dbbc8f5d2283b2cf282687a06d68b056e59 (diff) |
added more locking
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index f782212a16c..02de5a30794 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.14 2000/02/12 01:59:19 brianp Exp $ */ +/* $Id: texobj.c,v 1.15 2000/03/21 17:42:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -325,6 +325,8 @@ void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl_textur } +_glthread_DECLARE_STATIC_MUTEX(GenTexturesLock); + /* * Execute glGenTextures @@ -342,6 +344,12 @@ _mesa_GenTextures( GLsizei n, GLuint *texName ) return; } + + /* + * This must be atomic (generation and allocation of texture IDs) + */ + _glthread_LOCK_MUTEX(GenTexturesLock); + first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n); /* Return the texture names */ @@ -355,6 +363,8 @@ _mesa_GenTextures( GLsizei n, GLuint *texName ) GLuint dims = 0; (void) gl_alloc_texture_object(ctx->Shared, name, dims); } + + _glthread_UNLOCK_MUTEX(GenTexturesLock); } |