summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shared.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-03-01 10:21:07 -0700
committerBrian Paul <[email protected]>2014-03-03 13:08:58 -0700
commitd129ea7fa2e57288f64cd247a0ac6d876e1717d2 (patch)
tree599098d707f4b1c506b0e8ac4f614ea2a5d2de4f /src/mesa/main/shared.c
parent2706db701d6217d245325f90f014233ff40ba18c (diff)
mesa: switch to c11 mutex functions
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/main/shared.c')
-rw-r--r--src/mesa/main/shared.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 6a49348ce51..dc22025c2c6 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -62,7 +62,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
if (!shared)
return NULL;
- _glthread_INIT_MUTEX(shared->Mutex);
+ mtx_init(&shared->Mutex, mtx_plain);
shared->DisplayList = _mesa_NewHashTable();
shared->TexObjects = _mesa_NewHashTable();
@@ -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 */
- _glthread_INIT_MUTEX(shared->TexMutex);
+ mtx_init(&shared->TexMutex, mtx_plain);
shared->TextureStateStamp = 0;
shared->FrameBuffers = _mesa_NewHashTable();
@@ -354,8 +354,8 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
_mesa_HashDeleteAll(shared->TexObjects, delete_texture_cb, ctx);
_mesa_DeleteHashTable(shared->TexObjects);
- _glthread_DESTROY_MUTEX(shared->Mutex);
- _glthread_DESTROY_MUTEX(shared->TexMutex);
+ mtx_destroy(&shared->Mutex);
+ mtx_destroy(&shared->TexMutex);
free(shared);
}
@@ -378,11 +378,11 @@ _mesa_reference_shared_state(struct gl_context *ctx,
struct gl_shared_state *old = *ptr;
GLboolean delete;
- _glthread_LOCK_MUTEX(old->Mutex);
+ mtx_lock(&old->Mutex);
assert(old->RefCount >= 1);
old->RefCount--;
delete = (old->RefCount == 0);
- _glthread_UNLOCK_MUTEX(old->Mutex);
+ mtx_unlock(&old->Mutex);
if (delete) {
free_shared_state(ctx, old);
@@ -393,9 +393,9 @@ _mesa_reference_shared_state(struct gl_context *ctx,
if (state) {
/* reference new state */
- _glthread_LOCK_MUTEX(state->Mutex);
+ mtx_lock(&state->Mutex);
state->RefCount++;
*ptr = state;
- _glthread_UNLOCK_MUTEX(state->Mutex);
+ mtx_unlock(&state->Mutex);
}
}