List:Commits« Previous MessageNext Message »
From:marko.makela Date:October 5 2011 9:28am
Subject:bzr push into mysql-5.1 branch (marko.makela:3620 to 3621)
View as plain text  
 3621 Marko Mäkelä	2011-10-05
      Add InnoDB UNIV_SYNC_DEBUG assertions to rw-lock code.
      
      rw_lock_x_lock_func(): Assert that the thread is not already holding
      the lock in a conflicting mode (RW_LOCK_SHARED).
      
      rw_lock_s_lock_func(): Assert that the thread is not already holding
      the lock in a conflicting mode (RW_LOCK_EX).

    modified:
      storage/innobase/include/sync0rw.ic
      storage/innobase/sync/sync0rw.c
      storage/innodb_plugin/include/sync0rw.ic
      storage/innodb_plugin/sync/sync0rw.c
 3620 Marko Mäkelä	2011-10-04
      Correct the ChangeLog

    modified:
      storage/innodb_plugin/ChangeLog
=== modified file 'storage/innobase/include/sync0rw.ic'
--- a/storage/innobase/include/sync0rw.ic	revid:marko.makela@stripped80140-e1g2gcsj3j6f5pfu
+++ b/storage/innobase/include/sync0rw.ic	revid:marko.makela@strippedqpny2hz0iaj1
@@ -238,6 +238,7 @@ rw_lock_s_lock_func(
 
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED)); /* see NOTE above */
+	ut_ad(!rw_lock_own(lock, RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
 
 	mutex_enter(rw_lock_get_mutex(lock));

=== modified file 'storage/innobase/sync/sync0rw.c'
--- a/storage/innobase/sync/sync0rw.c	revid:marko.makela@strippedgcsj3j6f5pfu
+++ b/storage/innobase/sync/sync0rw.c	revid:marko.makela@stripped
@@ -476,6 +476,9 @@ rw_lock_x_lock_func(
 	ulint	i;	/* spin round count */
 
 	ut_ad(rw_lock_validate(lock));
+#ifdef UNIV_SYNC_DEBUG
+	ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
 
 lock_loop:
 	/* Acquire the mutex protecting the rw-lock fields */

=== modified file 'storage/innodb_plugin/include/sync0rw.ic'
--- a/storage/innodb_plugin/include/sync0rw.ic	revid:marko.makela@stripped
+++ b/storage/innodb_plugin/include/sync0rw.ic	revid:marko.makela@stripped
@@ -406,6 +406,7 @@ rw_lock_s_lock_func(
 
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED)); /* see NOTE above */
+	ut_ad(!rw_lock_own(lock, RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
 
 	/* TODO: study performance of UNIV_LIKELY branch prediction hints. */

=== modified file 'storage/innodb_plugin/sync/sync0rw.c'
--- a/storage/innodb_plugin/sync/sync0rw.c	revid:marko.makela@stripped111004180140-e1g2gcsj3j6f5pfu
+++ b/storage/innodb_plugin/sync/sync0rw.c	revid:marko.makela@stripped147-mj1pqpny2hz0iaj1
@@ -612,6 +612,9 @@ rw_lock_x_lock_func(
 	ibool   spinning = FALSE;
 
 	ut_ad(rw_lock_validate(lock));
+#ifdef UNIV_SYNC_DEBUG
+	ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
 
 	i = 0;
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1 branch (marko.makela:3620 to 3621) marko.makela5 Oct