List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:March 3 2009 12:42pm
Subject:bzr commit into mysql-6.0 branch (davi:2738) WL#4284
View as plain text  
# At a local mysql-6.0 repository of davi

 2738 Davi Arnaut	2009-03-03
      WL#4284: Small post-merge cleanups.
     @ sql/mdl.cc
        Remove unneeded forward declaration.
        
        Remove spurious new line.
        
        Remove awkward comment, it's obvious that the lock is only
        released when the last ticket associated to it is released.
        Even if the lock is released, its safe to compare the references
        as no locks are acquired inside the function.

    modified:
      sql/mdl.cc
=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc	2009-03-02 22:20:44 +0000
+++ b/sql/mdl.cc	2009-03-03 12:42:10 +0000
@@ -829,9 +829,6 @@ bool mdl_acquire_shared_lock(MDL_CONTEXT
 }
 
 
-static void release_ticket(MDL_CONTEXT *context, MDL_LOCK_TICKET *ticket);
-
-
 /**
   Notify a thread holding a shared metadata lock of a pending exclusive lock.
 
@@ -1059,7 +1056,6 @@ bool mdl_upgrade_shared_lock_to_exclusiv
 
   old_msg= MDL_ENTER_COND(context, mysys_var);
 
-
   /*
     Since we should have already acquired an intention exclusive
     global lock this call is only enforcing asserts.
@@ -1434,15 +1430,8 @@ void mdl_ticket_release(MDL_CONTEXT *con
 void mdl_ticket_release_all_for_name(MDL_CONTEXT *context,
                                      MDL_LOCK_TICKET *ticket)
 {
-  MDL_LOCK *lock;
-
-  /*
-    We can use MDL_LOCK_TICKET::lock here to identify other locks for the same
-    object since even though MDL_LOCK object might be reused for different
-    lock after the first lock for this object have been released we can't
-    have references to this other MDL_LOCK object in this context.
-  */
-  lock= ticket->lock;
+  /* Use MDL_LOCK_TICKET::lock to identify other locks for the same object. */
+  MDL_LOCK *lock= ticket->lock;
 
   /* Remove matching lock requests from the context. */
   MDL_LOCK_REQUEST *lock_req;


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20090303124210-1erw7wyxepmlqr1w.bundle
Thread
bzr commit into mysql-6.0 branch (davi:2738) WL#4284Davi Arnaut3 Mar