1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00

Applying InnoDB snapshot

Detailed revision comments:

r6446 | marko | 2010-01-13 17:20:10 +0200 (Wed, 13 Jan 2010) | 3 lines
branches/zip: Treat mem_hash_mutex specially in mutex_free(),
and explicitly free mem_hash_mutex in mem_close().
This fixes the breakage of UNIV_MEM_DEBUG that was filed as Issue #434.
This commit is contained in:
Sergey Vojtovich
2010-04-01 15:21:13 +04:00
parent 0ed513456f
commit 6d1e07322d
4 changed files with 29 additions and 4 deletions

View File

@@ -315,6 +315,15 @@ mutex_free(
ut_a(mutex_get_lock_word(mutex) == 0);
ut_a(mutex_get_waiters(mutex) == 0);
#ifdef UNIV_MEM_DEBUG
if (mutex == &mem_hash_mutex) {
ut_ad(UT_LIST_GET_LEN(mutex_list) == 1);
ut_ad(UT_LIST_GET_FIRST(mutex_list) == &mem_hash_mutex);
UT_LIST_REMOVE(list, mutex_list, mutex);
goto func_exit;
}
#endif /* UNIV_MEM_DEBUG */
if (mutex != &mutex_list_mutex
#ifdef UNIV_SYNC_DEBUG
&& mutex != &sync_thread_mutex
@@ -336,7 +345,9 @@ mutex_free(
}
os_event_free(mutex->event);
#ifdef UNIV_MEM_DEBUG
func_exit:
#endif /* UNIV_MEM_DEBUG */
#if !defined(HAVE_ATOMIC_BUILTINS)
os_fast_mutex_free(&(mutex->os_fast_mutex));
#endif
@@ -1370,6 +1381,12 @@ sync_close(void)
mutex = UT_LIST_GET_FIRST(mutex_list);
while (mutex) {
#ifdef UNIV_MEM_DEBUG
if (mutex == &mem_hash_mutex) {
mutex = UT_LIST_GET_NEXT(list, mutex);
continue;
}
#endif /* UNIV_MEM_DEBUG */
mutex_free(mutex);
mutex = UT_LIST_GET_FIRST(mutex_list);
}