summaryrefslogtreecommitdiff
path: root/innobase/ha
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-06-17 13:25:06 +0300
committerunknown <heikki@hundin.mysql.fi>2004-06-17 13:25:06 +0300
commita7139dd280e82a25ce2cbab80a10234b3911f215 (patch)
tree717a0df66b78f8229972912ed8c3b2c072894942 /innobase/ha
parent3414f67485dc7c6d55428691d8a62410bb8c630b (diff)
downloadmariadb-git-a7139dd280e82a25ce2cbab80a10234b3911f215.tar.gz
Cset exclude: marko@hundin.mysql.fi|ChangeSet|20040311211202|05613
innobase/trx/trx0sys.c: Remove #ifdef UNIV_HOT_BACKUP: best to keep the codebase as uniform as possible innobase/dict/dict0dict.c: Exclude innobase/dict/dict0mem.c: Exclude innobase/ha/hash0hash.c: Exclude innobase/include/data0data.h: Exclude innobase/include/dict0mem.h: Exclude innobase/include/hash0hash.h: Exclude innobase/include/hash0hash.ic: Exclude innobase/include/mtr0mtr.h: Exclude innobase/include/row0ins.h: Exclude innobase/include/row0upd.h: Exclude innobase/row/row0ins.c: Exclude innobase/row/row0upd.c: Exclude innobase/thr/thr0loc.c: Exclude
Diffstat (limited to 'innobase/ha')
-rw-r--r--innobase/ha/hash0hash.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/innobase/ha/hash0hash.c b/innobase/ha/hash0hash.c
index 808aa88da3d..1f7edf9d7d2 100644
--- a/innobase/ha/hash0hash.c
+++ b/innobase/ha/hash0hash.c
@@ -22,7 +22,6 @@ hash_mutex_enter(
hash_table_t* table, /* in: hash table */
ulint fold) /* in: fold */
{
- ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
mutex_enter(hash_get_mutex(table, fold));
}
@@ -35,10 +34,41 @@ hash_mutex_exit(
hash_table_t* table, /* in: hash table */
ulint fold) /* in: fold */
{
- ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
mutex_exit(hash_get_mutex(table, fold));
}
+/****************************************************************
+Reserves all the mutexes of a hash table, in an ascending order. */
+
+void
+hash_mutex_enter_all(
+/*=================*/
+ hash_table_t* table) /* in: hash table */
+{
+ ulint i;
+
+ for (i = 0; i < table->n_mutexes; i++) {
+
+ mutex_enter(table->mutexes + i);
+ }
+}
+
+/****************************************************************
+Releases all the mutexes of a hash table. */
+
+void
+hash_mutex_exit_all(
+/*================*/
+ hash_table_t* table) /* in: hash table */
+{
+ ulint i;
+
+ for (i = 0; i < table->n_mutexes; i++) {
+
+ mutex_exit(table->mutexes + i);
+ }
+}
+
/*****************************************************************
Creates a hash table with >= n array cells. The actual number of cells is
chosen to be a prime number slightly bigger than n. */
@@ -67,9 +97,7 @@ hash_create(
table->mutexes = NULL;
table->heaps = NULL;
table->heap = NULL;
-#ifdef UNIV_DEBUG
table->magic_n = HASH_TABLE_MAGIC_N;
-#endif /* UNIV_DEBUG */
/* Initialize the cell array */
@@ -90,7 +118,6 @@ hash_table_free(
/*============*/
hash_table_t* table) /* in, own: hash table */
{
- ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
ut_a(table->mutexes == NULL);
ut_free(table->array);
@@ -112,7 +139,6 @@ hash_create_mutexes(
ulint i;
ut_a(n_mutexes == ut_2_power_up(n_mutexes));
- ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
table->mutexes = mem_alloc(n_mutexes * sizeof(mutex_t));