summaryrefslogtreecommitdiff
path: root/innobase/srv
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-01-05 12:22:04 +0200
committerunknown <marko@hundin.mysql.fi>2005-01-05 12:22:04 +0200
commit0f8b518bee2fb0a6668095af90781688304cc85b (patch)
tree4a4546daaebeab6bcba0131b003b0892b0cfff5a /innobase/srv
parent509554c3cd843d02d164fee351b36a5efa5c334e (diff)
downloadmariadb-git-0f8b518bee2fb0a6668095af90781688304cc85b.tar.gz
InnoDB: Fix compiler warnings and some bad formatting introduced
in ChangeSet@1.1721.48.1 innobase/include/ut0ut.h: Add prototype for ut_usectime() innobase/srv/srv0srv.c: Fix some misformatted code. Remove a compiler warning about possibly uninitialized variable in srv_suspend_mysql_thread(). innobase/sync/sync0sync.c: Remove a compiler warning about possibly uninitialized variable in mutex_spin_wait(). innobase/ut/ut0ut.c: Improve the documentation and formatting of ut_usectime().
Diffstat (limited to 'innobase/srv')
-rw-r--r--innobase/srv/srv0srv.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 61bddc9da2c..15dacdf6333 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -346,10 +346,10 @@ static ulint srv_n_rows_updated_old = 0;
static ulint srv_n_rows_deleted_old = 0;
static ulint srv_n_rows_read_old = 0;
-ulint srv_n_lock_wait_count= 0;
-ulint srv_n_lock_wait_current_count= 0;
-ib_longlong srv_n_lock_wait_time= 0;
-ulint srv_n_lock_max_wait_time= 0;
+ulint srv_n_lock_wait_count = 0;
+ulint srv_n_lock_wait_current_count = 0;
+ib_longlong srv_n_lock_wait_time = 0;
+ulint srv_n_lock_max_wait_time = 0;
/*
@@ -1384,10 +1384,11 @@ srv_suspend_mysql_thread(
trx_t* trx;
ibool had_dict_lock = FALSE;
ibool was_declared_inside_innodb = FALSE;
- ib_longlong start_time, finish_time;
- ulint diff_time;
- ulint sec;
- ulint ms;
+ ib_longlong start_time = 0;
+ ib_longlong finish_time;
+ ulint diff_time;
+ ulint sec;
+ ulint ms;
#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
@@ -1430,15 +1431,14 @@ srv_suspend_mysql_thread(
os_event_reset(event);
slot->suspend_time = ut_time();
- if (thr->lock_state == QUE_THR_LOCK_ROW)
- {
- srv_n_lock_wait_count++;
- srv_n_lock_wait_current_count++;
- ut_usectime(&sec, &ms);
- start_time= (ib_longlong)sec * 1000000 + ms;
+ if (thr->lock_state == QUE_THR_LOCK_ROW) {
+ srv_n_lock_wait_count++;
+ srv_n_lock_wait_current_count++;
- }
+ ut_usectime(&sec, &ms);
+ start_time = (ib_longlong)sec * 1000000 + ms;
+ }
/* Wake the lock timeout monitor thread, if it is suspended */
os_event_set(srv_lock_timeout_thread_event);
@@ -1490,20 +1490,18 @@ srv_suspend_mysql_thread(
wait_time = ut_difftime(ut_time(), slot->suspend_time);
- if (thr->lock_state == QUE_THR_LOCK_ROW)
- {
- ut_usectime(&sec, &ms);
- finish_time= (ib_longlong)sec * 1000000 + ms;
-
- diff_time= finish_time-start_time;
+ if (thr->lock_state == QUE_THR_LOCK_ROW) {
+ ut_usectime(&sec, &ms);
+ finish_time = (ib_longlong)sec * 1000000 + ms;
+
+ diff_time = finish_time - start_time;
- srv_n_lock_wait_current_count--;
- srv_n_lock_wait_time= srv_n_lock_wait_time + diff_time;
- if (diff_time > srv_n_lock_max_wait_time)
- {
- srv_n_lock_max_wait_time= diff_time;
- }
- }
+ srv_n_lock_wait_current_count--;
+ srv_n_lock_wait_time = srv_n_lock_wait_time + diff_time;
+ if (diff_time > srv_n_lock_max_wait_time) {
+ srv_n_lock_max_wait_time = diff_time;
+ }
+ }
if (trx->was_chosen_as_deadlock_victim) {