Remove const qualifier from _mesa_HashLookup() table parameter to
avoid LOCK/UNLOCK warnings in the function body.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit
3094adb3caeb90124359db2356df3bf8ee94800a)
* \return pointer to user's data or NULL if key not in table
*/
void *
-_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key)
+_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
{
GLuint pos;
const struct HashEntry *entry;
assert(key);
pos = HASH_FUNC(key);
+ _glthread_LOCK_MUTEX(table->Mutex);
entry = table->Table[pos];
while (entry) {
if (entry->Key == key) {
- return entry->Data;
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return entry->Data;
}
entry = entry->Next;
}
+ _glthread_UNLOCK_MUTEX(table->Mutex);
return NULL;
}
extern void _mesa_DeleteHashTable(struct _mesa_HashTable *table);
-extern void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key);
+extern void *_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key);
extern void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data);