GLboolean deleteFlag = GL_FALSE;
struct gl_sampler_object *oldSamp = *ptr;
- /*mtx_lock(&oldSamp->Mutex);*/
+ mtx_lock(&oldSamp->Mutex);
assert(oldSamp->RefCount > 0);
oldSamp->RefCount--;
deleteFlag = (oldSamp->RefCount == 0);
- /*mtx_unlock(&oldSamp->Mutex);*/
+ mtx_unlock(&oldSamp->Mutex);
if (deleteFlag) {
assert(ctx->Driver.DeleteSamplerObject);
if (samp) {
/* reference new sampler */
- /*mtx_lock(&samp->Mutex);*/
+ mtx_lock(&samp->Mutex);
if (samp->RefCount == 0) {
/* this sampler's being deleted (look just above) */
/* Not sure this can every really happen. Warn if it does. */
samp->RefCount++;
*ptr = samp;
}
- /*mtx_unlock(&samp->Mutex);*/
+ mtx_unlock(&samp->Mutex);
}
}
static void
_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name)
{
+ mtx_init(&sampObj->Mutex, mtx_plain);
sampObj->Name = name;
sampObj->RefCount = 1;
sampObj->WrapS = GL_REPEAT;
_mesa_delete_sampler_object(struct gl_context *ctx,
struct gl_sampler_object *sampObj)
{
+ mtx_destroy(&sampObj->Mutex);
free(sampObj->Label);
free(sampObj);
}