Commit 8ea807c6 authored by unknown's avatar unknown

Merge from mysql-5.1 to mysql-5.5

parents 0122a138 c6d47e6e
...@@ -542,7 +542,7 @@ mutex. */ ...@@ -542,7 +542,7 @@ mutex. */
UNIV_INTERN UNIV_INTERN
void void
rw_lock_debug_mutex_enter(void); rw_lock_debug_mutex_enter(void);
/*==========================*/ /*===========================*/
/******************************************************************//** /******************************************************************//**
Releases the debug mutex. */ Releases the debug mutex. */
UNIV_INTERN UNIV_INTERN
...@@ -632,7 +632,8 @@ struct rw_lock_struct { ...@@ -632,7 +632,8 @@ struct rw_lock_struct {
}; };
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
/** The structure for storing debug info of an rw-lock */ /** The structure for storing debug info of an rw-lock. All access to this
structure must be protected by rw_lock_debug_mutex_enter(). */
struct rw_lock_debug_struct { struct rw_lock_debug_struct {
os_thread_id_t thread_id; /*!< The thread id of the thread which os_thread_id_t thread_id; /*!< The thread id of the thread which
......
...@@ -715,7 +715,7 @@ mutex. */ ...@@ -715,7 +715,7 @@ mutex. */
UNIV_INTERN UNIV_INTERN
void void
rw_lock_debug_mutex_enter(void) rw_lock_debug_mutex_enter(void)
/*==========================*/ /*===========================*/
{ {
loop: loop:
if (0 == mutex_enter_nowait(&rw_lock_debug_mutex)) { if (0 == mutex_enter_nowait(&rw_lock_debug_mutex)) {
...@@ -942,11 +942,13 @@ rw_lock_list_print_info( ...@@ -942,11 +942,13 @@ rw_lock_list_print_info(
putc('\n', file); putc('\n', file);
} }
rw_lock_debug_mutex_enter();
info = UT_LIST_GET_FIRST(lock->debug_list); info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) { while (info != NULL) {
rw_lock_debug_print(file, info); rw_lock_debug_print(file, info);
info = UT_LIST_GET_NEXT(list, info); info = UT_LIST_GET_NEXT(list, info);
} }
rw_lock_debug_mutex_exit();
} }
#ifndef INNODB_RW_LOCKS_USE_ATOMICS #ifndef INNODB_RW_LOCKS_USE_ATOMICS
mutex_exit(&(lock->mutex)); mutex_exit(&(lock->mutex));
...@@ -990,11 +992,13 @@ rw_lock_print( ...@@ -990,11 +992,13 @@ rw_lock_print(
putc('\n', stderr); putc('\n', stderr);
} }
rw_lock_debug_mutex_enter();
info = UT_LIST_GET_FIRST(lock->debug_list); info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) { while (info != NULL) {
rw_lock_debug_print(stderr, info); rw_lock_debug_print(stderr, info);
info = UT_LIST_GET_NEXT(list, info); info = UT_LIST_GET_NEXT(list, info);
} }
rw_lock_debug_mutex_exit();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment