List:Commits« Previous MessageNext Message »
From:Kevin Lewis Date:December 19 2008 5:59am
Subject:bzr commit into mysql-6.0-falcon-team branch (klewis:2939) Bug#41521,
Bug#41564
View as plain text  
#At file:///C:/Work/bzr/Merge/mysql-6.0-falcon-team/

 2939 Kevin Lewis	2008-12-18
      Bug#41521 and Bug#41564.  
      Sometimes a call to  Thread::sleep(timeout, callersMutex)
      from SyncObject::wait() can wakeup before the lock has been 
      granted.  If it does this, the code was taking the thread 
      off the SyncObject queue and then calling the sleep again. 
      This time, the lock cannot be granted because the lock owner
      does not signal the waiting thread.  It is not queued.
      A lock wait timeout will then occur.
      The thread should only be taken off the queue if a lock wait 
      timeout really does occur.
modified:
  storage/falcon/SyncObject.cpp

per-file messages:
  storage/falcon/SyncObject.cpp
    Bug#41521 and Bug#41564.  
    Sometimes a call to  Thread::sleep(timeout, callersMutex)
    from SyncObject::wait() can wakeup before the lock has been 
    granted.  If it does this, the code was taking the thread 
    off the SyncObject queue and then calling the sleep again. 
    This time, the lock cannot be granted because the lock owner
    does not signal the waiting thread.  It is not queued.
    A lock wait timeout will then occur.
    The thread should only be taken off the queue if a lock wait 
    timeout really does occur.
     SyncOnject::wai
=== modified file 'storage/falcon/SyncObject.cpp'
--- a/storage/falcon/SyncObject.cpp	2008-10-16 02:59:09 +0000
+++ b/storage/falcon/SyncObject.cpp	2008-12-19 05:59:34 +0000
@@ -638,16 +638,19 @@ void SyncObject::wait(LockType type, Thr
 				return;
 				}
 			
-			for (ptr = &queue; *ptr; ptr = &(*ptr)->queue)
-				if (*ptr == thread)
-					{
-					*ptr = thread->queue;
-					--waiters;
-					break;
-					}
-			
 			if (!wokeup)
 				{
+				// A timeout occured.
+				// Take this thread off the queue and throw an exception
+
+				for (ptr = &queue; *ptr; ptr = &(*ptr)->queue)
+					if (*ptr == thread)
+						{
+						*ptr = thread->queue;
+						--waiters;
+						break;
+						}
+
 				mutex.release();
 				timedout(timeout);
 				}

Thread
bzr commit into mysql-6.0-falcon-team branch (klewis:2939) Bug#41521,Bug#41564Kevin Lewis19 Dec