List:Commits« Previous MessageNext Message »
From:cbell Date:December 20 2007 10:06pm
Subject:bk commit into 6.0 tree (cbell:1.2754) BUG#33296
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of cbell. When cbell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-12-20 17:06:18-05:00, cbell@mysql_cab_desk. +1 -0
  BUG#33296 : Error deleting mutex in locking thread
  
  This patch moves the mutex lock before the inspection of the
  variable to prevent the race condition of the destructor
  inspecting the state then destroying the mutex before the
  locking thread (which is in it's CS) is finished. 

  sql/backup/be_thread.cc@stripped, 2007-12-20 17:06:12-05:00, cbell@mysql_cab_desk. +4 -2
    BUG#33296 : Error deleting mutex in locking thread
    
    This patch moves the mutex lock before the inspection of the
    variable to prevent the race condition of the destructor
    inspecting the state then destroying the mutex before the
    locking thread (which is in it's CS) is finished. 

diff -Nrup a/sql/backup/be_thread.cc b/sql/backup/be_thread.cc
--- a/sql/backup/be_thread.cc	2007-12-04 12:38:06 -05:00
+++ b/sql/backup/be_thread.cc	2007-12-20 17:06:12 -05:00
@@ -225,10 +225,10 @@ Locking_thread_st::~Locking_thread_st()
     it is finished so that we can destroy the mutexes safely knowing
     the locking thread won't access them.
   */
+  kill_locking_thread();
+  pthread_mutex_lock(&THR_LOCK_caller);
   if (lock_state != LOCK_DONE)
   {
-    kill_locking_thread();
-    pthread_mutex_lock(&THR_LOCK_caller);
     m_thd->enter_cond(&COND_caller_wait, &THR_LOCK_caller,
                     "Locking thread: waiting until locking thread is done");
     while (lock_state != LOCK_DONE)
@@ -237,6 +237,8 @@ Locking_thread_st::~Locking_thread_st()
 
     DBUG_PRINT("info",("Locking thread's locking thread terminated"));
   }
+  else
+    pthread_mutex_unlock(&THR_LOCK_caller);
 
   /*
     Destroy the thread mutexes and cond variables.

Thread
bk commit into 6.0 tree (cbell:1.2754) BUG#33296cbell20 Dec
  • Re: bk commit into 6.0 tree (cbell:1.2754) BUG#33296Rafal Somla28 Jan