summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2011-03-30 14:52:26 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2011-03-30 14:52:26 +0300
commita120b650d2214d3fa099479cb5f879d428b6a01d (patch)
tree4cbf5f5aaf732a0cdf90756841cd9f116fcd72ad /storage/innobase/srv
parent88650f36f41238952a0f5139e1881aef7b642729 (diff)
parent4ffb26de4baba4fc1d012d3bb9a4033752f3d887 (diff)
downloadmariadb-git-a120b650d2214d3fa099479cb5f879d428b6a01d.tar.gz
Merge mysql-5.1-innodb to mysql-5.5-innodb.
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0srv.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 99af0b23a04..3af7a86a164 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -2367,6 +2367,12 @@ srv_error_monitor_thread(
ib_uint64_t old_lsn;
ib_uint64_t new_lsn;
ib_int64_t sig_count;
+ /* longest waiting thread for a semaphore */
+ os_thread_id_t waiter = os_thread_get_curr_id();
+ os_thread_id_t old_waiter = waiter;
+ /* the semaphore that is being waited for */
+ const void* sema = NULL;
+ const void* old_sema = NULL;
old_lsn = srv_start_lsn;
@@ -2420,7 +2426,8 @@ loop:
sync_arr_wake_threads_if_sema_free();
- if (sync_array_print_long_waits()) {
+ if (sync_array_print_long_waits(&waiter, &sema)
+ && sema == old_sema && os_thread_eq(waiter, old_waiter)) {
fatal_cnt++;
if (fatal_cnt > 10) {
@@ -2435,6 +2442,8 @@ loop:
}
} else {
fatal_cnt = 0;
+ old_waiter = waiter;
+ old_sema = sema;
}
/* Flush stderr so that a database user gets the output