_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
{
void *res;
- assert(table);
- mtx_lock(&table->Mutex);
+ _mesa_HashLockMutex(table);
res = _mesa_HashLookup_unlocked(table, key);
- mtx_unlock(&table->Mutex);
+ _mesa_HashUnlockMutex(table);
return res;
}
void
_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
{
- assert(table);
- mtx_lock(&table->Mutex);
+ _mesa_HashLockMutex(table);
_mesa_HashInsert_unlocked(table, key, data);
- mtx_unlock(&table->Mutex);
+ _mesa_HashUnlockMutex(table);
}
void
_mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
{
- mtx_lock(&table->Mutex);
+ _mesa_HashLockMutex(table);
_mesa_HashRemove_unlocked(table, key);
- mtx_unlock(&table->Mutex);
+ _mesa_HashUnlockMutex(table);
}
/**
{
struct hash_entry *entry;
- assert(table);
assert(callback);
- mtx_lock(&table->Mutex);
+ _mesa_HashLockMutex(table);
table->InDeleteAll = GL_TRUE;
hash_table_foreach(table->ht, entry) {
callback((uintptr_t)entry->key, entry->data, userData);
table->deleted_key_data = NULL;
}
table->InDeleteAll = GL_FALSE;
- mtx_unlock(&table->Mutex);
+ _mesa_HashUnlockMutex(table);
}
/* cast-away const */
struct _mesa_HashTable *table2 = (struct _mesa_HashTable *) table;
- mtx_lock(&table2->Mutex);
+ _mesa_HashLockMutex(table2);
hash_walk_unlocked(table, callback, userData);
- mtx_unlock(&table2->Mutex);
+ _mesa_HashUnlockMutex(table2);
}
void