void
_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
{
+ struct set_entry *entry;
+
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
syncObj->RefCount--;
if (syncObj->RefCount == 0) {
- _mesa_set_remove(ctx->Shared->SyncObjects, syncObj->SetEntry);
+ entry = _mesa_set_search(ctx->Shared->SyncObjects,
+ _mesa_hash_pointer(syncObj),
+ syncObj);
+ assert (entry != NULL);
+ _mesa_set_remove(ctx->Shared->SyncObjects, entry);
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
ctx->Driver.DeleteSyncObject(ctx, syncObj);
ctx->Driver.FenceSync(ctx, syncObj, condition, flags);
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
- syncObj->SetEntry = _mesa_set_add(ctx->Shared->SyncObjects,
- _mesa_hash_pointer(syncObj),
- syncObj);
+ _mesa_set_add(ctx->Shared->SyncObjects,
+ _mesa_hash_pointer(syncObj),
+ syncObj);
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
return (GLsync) syncObj;