Commit bd77a36e authored by sbains's avatar sbains

branches/innodb+: Add a check for thread suspended time to the list of checks

for slot recycle. Udpate the comments.
parent af1478e0
...@@ -2264,10 +2264,11 @@ srv_lock_check_wait( ...@@ -2264,10 +2264,11 @@ srv_lock_check_wait(
trx_t* trx; trx_t* trx;
double wait_time; double wait_time;
ulong lock_wait_timeout; ulong lock_wait_timeout;
ib_time_t suspend_time = slot->suspend_time;
ut_ad(srv_sys_mutex_own()); ut_ad(srv_sys_mutex_own());
wait_time = ut_difftime(ut_time(), slot->suspend_time); wait_time = ut_difftime(ut_time(), suspend_time);
trx = thr_get_trx(slot->thr); trx = thr_get_trx(slot->thr);
...@@ -2307,16 +2308,18 @@ srv_lock_check_wait( ...@@ -2307,16 +2308,18 @@ srv_lock_check_wait(
/* We can't compare the pointers here because the /* We can't compare the pointers here because the
memory can be recycled. Transaction ids are not memory can be recycled. Transaction ids are not
recyled and therefore safe to use. If the transaction recyled and therefore safe to use. We also check if
has already released its locks there is nothing the transaction suspend time is the same that we
more we can do. */ used for calculating the wait earlier. If the
transaction has already released its locks there
is nothing more we can do. */
if (slot->in_use if (slot->in_use
&& suspend_time == slot->suspend_time
&& ut_dulint_cmp(trx->id, slot_trx->id) == 0 && ut_dulint_cmp(trx->id, slot_trx->id) == 0
&& trx->wait_lock != NULL) { && trx->wait_lock != NULL) {
ut_a(trx->que_state == TRX_QUE_LOCK_WAIT); ut_a(trx->que_state == TRX_QUE_LOCK_WAIT);
/* Note that the caller is the timeout thread */
lock_cancel_waiting_and_release( lock_cancel_waiting_and_release(
trx->wait_lock); trx->wait_lock);
} }
......
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