summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shared.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-10-16 11:59:31 +1100
committerTimothy Arceri <[email protected]>2017-11-09 12:07:48 +1100
commitf0857fe87b6e8985cb1d0ec46c1a358c4cf37c29 (patch)
tree6af78cdb291120353e2741681c7799b5799104df /src/mesa/main/shared.c
parentf98a2768ca0609fb81a0ee8f30ac1e70269334c4 (diff)
mesa: use simple mtx in core mesa
Results from x11perf -copywinwin10 on Eric's SKL: 4.33338% ± 0.905054% (n=40) Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Yogesh Marathe <[email protected]>
Diffstat (limited to 'src/mesa/main/shared.c')
-rw-r--r--src/mesa/main/shared.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 53b8597d560..e3417a4df30 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -66,7 +66,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
if (!shared)
return NULL;
- mtx_init(&shared->Mutex, mtx_plain);
+ simple_mtx_init(&shared->Mutex, mtx_plain);
shared->DisplayList = _mesa_NewHashTable();
shared->BitmapAtlas = _mesa_NewHashTable();
@@ -435,7 +435,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
_mesa_DeleteHashTable(shared->MemoryObjects);
}
- mtx_destroy(&shared->Mutex);
+ simple_mtx_destroy(&shared->Mutex);
mtx_destroy(&shared->TexMutex);
free(shared);
@@ -459,11 +459,11 @@ _mesa_reference_shared_state(struct gl_context *ctx,
struct gl_shared_state *old = *ptr;
GLboolean delete;
- mtx_lock(&old->Mutex);
+ simple_mtx_lock(&old->Mutex);
assert(old->RefCount >= 1);
old->RefCount--;
delete = (old->RefCount == 0);
- mtx_unlock(&old->Mutex);
+ simple_mtx_unlock(&old->Mutex);
if (delete) {
free_shared_state(ctx, old);
@@ -474,9 +474,9 @@ _mesa_reference_shared_state(struct gl_context *ctx,
if (state) {
/* reference new state */
- mtx_lock(&state->Mutex);
+ simple_mtx_lock(&state->Mutex);
state->RefCount++;
*ptr = state;
- mtx_unlock(&state->Mutex);
+ simple_mtx_unlock(&state->Mutex);
}
}