List:Maria Storage Engine« Previous MessageNext Message »
From:Guilhem Bichot Date:October 17 2008 1:38pm
Subject:bzr commit into MySQL/Maria:mysql-maria branch (guilhem:2683)
View as plain text  
#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/

 2683 Guilhem Bichot	2008-10-17
      calling make_lock_and_pin() without cache's mutex is wrong (patch from Sanja).
modified:
  storage/maria/ma_pagecache.c

per-file messages:
  storage/maria/ma_pagecache.c
    calling make_lock_and_pin() without cache's mutex is wrong (patch from Sanja)
=== modified file 'storage/maria/ma_pagecache.c'
--- a/storage/maria/ma_pagecache.c	2008-10-16 19:44:12 +0000
+++ b/storage/maria/ma_pagecache.c	2008-10-17 13:38:25 +0000
@@ -2943,15 +2943,16 @@ void pagecache_unlock_by_link(PAGECACHE 
   DBUG_ASSERT(pin != PAGECACHE_PIN_LEFT_UNPINNED);
   DBUG_ASSERT(lock != PAGECACHE_LOCK_READ);
   DBUG_ASSERT(lock != PAGECACHE_LOCK_WRITE);
+  pagecache_pthread_mutex_lock(&pagecache->cache_lock);
   if (pin == PAGECACHE_PIN_LEFT_UNPINNED &&
       lock == PAGECACHE_LOCK_READ_UNLOCK)
   {
     if (make_lock_and_pin(pagecache, block, lock, pin, FALSE))
       DBUG_ASSERT(0);                         /* should not happend */
+    pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
     DBUG_VOID_RETURN;
   }
 
-  pagecache_pthread_mutex_lock(&pagecache->cache_lock);
   /*
     As soon as we keep lock cache can be used, and we have lock because want
     unlock.

Thread
bzr commit into MySQL/Maria:mysql-maria branch (guilhem:2683) Guilhem Bichot17 Oct