diff options
Diffstat (limited to 'storage/maria/tablockman.c')
-rw-r--r-- | storage/maria/tablockman.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/storage/maria/tablockman.c b/storage/maria/tablockman.c index 1bb8889aaa7..8e664b261e9 100644 --- a/storage/maria/tablockman.c +++ b/storage/maria/tablockman.c @@ -225,12 +225,10 @@ struct st_table_lock { uchar lock_type; }; -#define hash_insert my_hash_insert /* for consistency :) */ - static inline TABLE_LOCK *find_by_loid(LOCKED_TABLE *table, uint16 loid) { - return (TABLE_LOCK *)hash_search(& table->latest_locks, + return (TABLE_LOCK *)my_hash_search(& table->latest_locks, (uchar *)& loid, sizeof(loid)); } @@ -485,8 +483,8 @@ tablockman_getlock(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo, /* update the latest_locks hash */ if (old) - hash_delete(& table->latest_locks, (uchar *)old); - hash_insert(& table->latest_locks, (uchar *)new); + my_hash_delete(& table->latest_locks, (uchar *)old); + my_hash_insert(& table->latest_locks, (uchar *)new); new->upgraded_from= old; @@ -569,7 +567,7 @@ void tablockman_release_locks(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo) /* TODO ? group locks by table to reduce the number of mutex locks */ pthread_mutex_lock(mutex); - hash_delete(& cur->table->latest_locks, (uchar *)cur); + my_hash_delete(& cur->table->latest_locks, (uchar *)cur); if (cur->prev) cur->prev->next= cur->next; @@ -616,7 +614,7 @@ void tablockman_destroy(TABLOCKMAN *lm) { TABLE_LOCK *tmp= lm->pool; lm->pool= tmp->next; - my_free((void *)tmp, MYF(0)); + my_free(tmp); } pthread_mutex_destroy(& lm->pool_mutex); } @@ -632,7 +630,7 @@ void tablockman_init_locked_table(LOCKED_TABLE *lt, int initial_hash_size) { bzero(lt, sizeof(*lt)); pthread_mutex_init(& lt->mutex, MY_MUTEX_INIT_FAST); - hash_init(& lt->latest_locks, & my_charset_bin, initial_hash_size, + my_hash_init(& lt->latest_locks, & my_charset_bin, initial_hash_size, offsetof(TABLE_LOCK, loid), sizeof(((TABLE_LOCK*)0)->loid), 0, 0, 0); } @@ -647,7 +645,7 @@ void tablockman_destroy_locked_table(LOCKED_TABLE *lt) for (i= 0; i<LOCK_TYPES; i++) DBUG_ASSERT(lt->active_locks[i] == 0); - hash_free(& lt->latest_locks); + my_hash_free(& lt->latest_locks); pthread_mutex_destroy(& lt->mutex); } |