List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:June 10 2010 7:36am
Subject:bzr commit into mysql-5.6-innodb branch (Sunny.Bains:3139)
View as plain text  
#At file:///Users/sunny/innodb/bzr-new/5.6/ based on revid:sunny.bains@stripped

 3139 Sunny Bains	2010-06-10
      Port some more fixes from the uncommitted code.

    modified:
      storage/innobase/include/sync0sync.h
      storage/innobase/lock/lock0lock.c
      storage/innobase/lock/lock0wait.c
=== modified file 'storage/innobase/include/sync0sync.h'
--- a/storage/innobase/include/sync0sync.h	revid:sunny.bains@stripped
+++ b/storage/innobase/include/sync0sync.h	revid:sunny.bains@stripped
@@ -589,7 +589,7 @@ V
 File system pages
 |
 V
-lock_sys_wait_mutex			Mutex protecting lock_sys_t
+lock_sys_wait_mutex			Mutex protecting lock timeout data
 |
 V
 lock_sys_mutex				Mutex protecting lock_sys_t

=== modified file 'storage/innobase/lock/lock0lock.c'
--- a/storage/innobase/lock/lock0lock.c	revid:sunny.bains@stripped
+++ b/storage/innobase/lock/lock0lock.c	revid:sunny.bains@stripped
@@ -2207,7 +2207,13 @@ lock_grant(
 	for it */
 
 	if (lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
-		que_thr_end_lock_wait(lock->trx);
+		que_thr_t*	thr;
+
+		thr = que_thr_end_lock_wait(lock->trx);
+
+		if (thr != NULL) {
+			lock_wait_release_thread_if_suspended(thr);
+		}
 	}
 
 	trx_mutex_exit(lock->trx);
@@ -2223,6 +2229,8 @@ lock_rec_cancel(
 /*============*/
 	lock_t*	lock)	/*!< in: waiting record lock request */
 {
+	que_thr_t*	thr;
+
 	ut_ad(lock_mutex_own());
 	ut_ad(lock_get_type_low(lock) == LOCK_REC);
 
@@ -2237,7 +2245,11 @@ lock_rec_cancel(
 
 	/* The following function releases the trx from lock wait */
 
-	que_thr_end_lock_wait(lock->trx);
+	thr = que_thr_end_lock_wait(lock->trx);
+
+	if (thr != NULL) {
+		lock_wait_release_thread_if_suspended(thr);
+	}
 
 	trx_mutex_exit(lock->trx);
 }
@@ -5767,6 +5779,8 @@ lock_cancel_waiting_and_release(
 /*============================*/
 	lock_t*	lock)	/*!< in: waiting lock request */
 {
+	que_thr_t*	thr;
+
 	ut_ad(lock_mutex_own());
 	ut_ad(trx_mutex_own(lock->trx));
 
@@ -5790,5 +5804,9 @@ lock_cancel_waiting_and_release(
 
 	/* The following function releases the trx from lock wait. */
 
-	que_thr_end_lock_wait(lock->trx);
+	thr = que_thr_end_lock_wait(lock->trx);
+
+	if (thr != NULL) {
+		lock_wait_release_thread_if_suspended(thr);
+	}
 }

=== modified file 'storage/innobase/lock/lock0wait.c'
--- a/storage/innobase/lock/lock0wait.c	revid:sunny.bains@stripped
+++ b/storage/innobase/lock/lock0wait.c	revid:sunny.bains@stripped
@@ -407,6 +407,8 @@ lock_wait_check_and_cancel(
 
 	trx = thr_get_trx(slot->thr);
 
+	lock_mutex_enter();
+
 	trx_mutex_enter(trx);
 
 	lock_wait_timeout = thd_lock_wait_timeout(trx->mysql_thd);
@@ -427,13 +429,13 @@ lock_wait_check_and_cancel(
 
 			ut_a(trx->lock.que_state == TRX_QUE_LOCK_WAIT);
 
-			printf("Timeout: %p\n", trx);
-
 			lock_cancel_waiting_and_release(trx->lock.wait_lock);
 		}
 	}
 
 	trx_mutex_exit(trx);
+	
+	lock_mutex_exit();
 }
 
 /*********************************************************************//**


Attachment: [text/bzr-bundle] bzr/sunny.bains@oracle.com-20100610073538-dxjbzbr6jybg0inq.bundle
Thread
bzr commit into mysql-5.6-innodb branch (Sunny.Bains:3139) Sunny Bains10 Jun