struct gl_sync_object b;
struct pipe_fence_handle *fence;
- mtx_t mutex; /**< protects "fence" */
+ simple_mtx_t mutex; /**< protects "fence" */
};
{
struct st_sync_object *so = CALLOC_STRUCT(st_sync_object);
- mtx_init(&so->mutex, mtx_plain);
+ simple_mtx_init(&so->mutex, mtx_plain);
return &so->b;
}
struct st_sync_object *so = (struct st_sync_object*)obj;
screen->fence_reference(screen, &so->fence, NULL);
- mtx_destroy(&so->mutex);
+ simple_mtx_destroy(&so->mutex);
free(so->b.Label);
free(so);
}
struct pipe_fence_handle *fence = NULL;
/* If the fence doesn't exist, assume it's signalled. */
- mtx_lock(&so->mutex);
+ simple_mtx_lock(&so->mutex);
if (!so->fence) {
- mtx_unlock(&so->mutex);
+ simple_mtx_unlock(&so->mutex);
so->b.StatusFlag = GL_TRUE;
return;
}
* fence_finish unlocked.
*/
screen->fence_reference(screen, &fence, so->fence);
- mtx_unlock(&so->mutex);
+ simple_mtx_unlock(&so->mutex);
/* Section 4.1.2 of OpenGL 4.5 (Compatibility Profile) says:
* [...] if ClientWaitSync is called and all of the following are true:
* forget to set it.
*/
if (screen->fence_finish(screen, pipe, fence, timeout)) {
- mtx_lock(&so->mutex);
+ simple_mtx_lock(&so->mutex);
screen->fence_reference(screen, &so->fence, NULL);
- mtx_unlock(&so->mutex);
+ simple_mtx_unlock(&so->mutex);
so->b.StatusFlag = GL_TRUE;
}
screen->fence_reference(screen, &fence, NULL);
return;
/* If the fence doesn't exist, assume it's signalled. */
- mtx_lock(&so->mutex);
+ simple_mtx_lock(&so->mutex);
if (!so->fence) {
- mtx_unlock(&so->mutex);
+ simple_mtx_unlock(&so->mutex);
so->b.StatusFlag = GL_TRUE;
return;
}
/* We need a local copy of the fence pointer. */
screen->fence_reference(screen, &fence, so->fence);
- mtx_unlock(&so->mutex);
+ simple_mtx_unlock(&so->mutex);
pipe->fence_server_sync(pipe, fence);
screen->fence_reference(screen, &fence, NULL);
/* We need a mutex since this function may be called from one thread
* while free_zombie_resource_views() is called from another.
*/
- mtx_lock(&st->zombie_sampler_views.mutex);
+ simple_mtx_lock(&st->zombie_sampler_views.mutex);
LIST_ADDTAIL(&entry->node, &st->zombie_sampler_views.list.node);
- mtx_unlock(&st->zombie_sampler_views.mutex);
+ simple_mtx_unlock(&st->zombie_sampler_views.mutex);
}
/* We need a mutex since this function may be called from one thread
* while free_zombie_shaders() is called from another.
*/
- mtx_lock(&st->zombie_shaders.mutex);
+ simple_mtx_lock(&st->zombie_shaders.mutex);
LIST_ADDTAIL(&entry->node, &st->zombie_shaders.list.node);
- mtx_unlock(&st->zombie_shaders.mutex);
+ simple_mtx_unlock(&st->zombie_shaders.mutex);
}
return;
}
- mtx_lock(&st->zombie_sampler_views.mutex);
+ simple_mtx_lock(&st->zombie_sampler_views.mutex);
LIST_FOR_EACH_ENTRY_SAFE(entry, next,
&st->zombie_sampler_views.list.node, node) {
assert(LIST_IS_EMPTY(&st->zombie_sampler_views.list.node));
- mtx_unlock(&st->zombie_sampler_views.mutex);
+ simple_mtx_unlock(&st->zombie_sampler_views.mutex);
}
return;
}
- mtx_lock(&st->zombie_shaders.mutex);
+ simple_mtx_lock(&st->zombie_shaders.mutex);
LIST_FOR_EACH_ENTRY_SAFE(entry, next,
&st->zombie_shaders.list.node, node) {
assert(LIST_IS_EMPTY(&st->zombie_shaders.list.node));
- mtx_unlock(&st->zombie_shaders.mutex);
+ simple_mtx_unlock(&st->zombie_shaders.mutex);
}
LIST_INITHEAD(&st->winsys_buffers);
LIST_INITHEAD(&st->zombie_sampler_views.list.node);
- mtx_init(&st->zombie_sampler_views.mutex, mtx_plain);
+ simple_mtx_init(&st->zombie_sampler_views.mutex, mtx_plain);
LIST_INITHEAD(&st->zombie_shaders.list.node);
- mtx_init(&st->zombie_shaders.mutex, mtx_plain);
+ simple_mtx_init(&st->zombie_shaders.mutex, mtx_plain);
return st;
}
st_context_free_zombie_objects(st);
- mtx_destroy(&st->zombie_sampler_views.mutex);
- mtx_destroy(&st->zombie_shaders.mutex);
+ simple_mtx_destroy(&st->zombie_sampler_views.mutex);
+ simple_mtx_destroy(&st->zombie_shaders.mutex);
st_reference_fragprog(st, &st->fp, NULL);
st_reference_prog(st, &st->gp, NULL);
struct {
struct st_zombie_sampler_view_node list;
- mtx_t mutex;
+ simple_mtx_t mutex;
} zombie_sampler_views;
struct {
struct st_zombie_shader_node list;
- mtx_t mutex;
+ simple_mtx_t mutex;
} zombie_shaders;
};
struct st_manager_private
{
struct hash_table *stfbi_ht; /* framebuffer iface objects hash table */
- mtx_t st_mutex;
+ simple_mtx_t st_mutex;
};
assert(smPriv);
assert(smPriv->stfbi_ht);
- mtx_lock(&smPriv->st_mutex);
+ simple_mtx_lock(&smPriv->st_mutex);
entry = _mesa_hash_table_search(smPriv->stfbi_ht, stfbi);
- mtx_unlock(&smPriv->st_mutex);
+ simple_mtx_unlock(&smPriv->st_mutex);
return entry != NULL;
}
assert(smPriv);
assert(smPriv->stfbi_ht);
- mtx_lock(&smPriv->st_mutex);
+ simple_mtx_lock(&smPriv->st_mutex);
entry = _mesa_hash_table_insert(smPriv->stfbi_ht, stfbi, stfbi);
- mtx_unlock(&smPriv->st_mutex);
+ simple_mtx_unlock(&smPriv->st_mutex);
return entry != NULL;
}
if (!smPriv || !smPriv->stfbi_ht)
return;
- mtx_lock(&smPriv->st_mutex);
+ simple_mtx_lock(&smPriv->st_mutex);
entry = _mesa_hash_table_search(smPriv->stfbi_ht, stfbi);
if (!entry)
goto unlock;
_mesa_hash_table_remove(smPriv->stfbi_ht, entry);
unlock:
- mtx_unlock(&smPriv->st_mutex);
+ simple_mtx_unlock(&smPriv->st_mutex);
}
if (smPriv && smPriv->stfbi_ht) {
_mesa_hash_table_destroy(smPriv->stfbi_ht, NULL);
- mtx_destroy(&smPriv->st_mutex);
+ simple_mtx_destroy(&smPriv->st_mutex);
free(smPriv);
smapi->st_manager_private = NULL;
}
struct st_manager_private *smPriv;
smPriv = CALLOC_STRUCT(st_manager_private);
- mtx_init(&smPriv->st_mutex, mtx_plain);
+ simple_mtx_init(&smPriv->st_mutex, mtx_plain);
smPriv->stfbi_ht = _mesa_hash_table_create(NULL,
st_framebuffer_iface_hash,
st_framebuffer_iface_equal);