Title: [133001] trunk/Source/WebKit2
Revision
133001
Author
[email protected]
Date
2012-10-31 02:10:39 -0700 (Wed, 31 Oct 2012)

Log Message

[WK2] Change the scope of locking in CoreIPC::Connection class.
https://bugs.webkit.org/show_bug.cgi?id=98998

Patch by Byungwoo Lee <[email protected]> on 2012-10-31
Reviewed by Laszlo Gombos.

Release the m_incomingMessagesLock and m_outgoingMessagesLock mutexes
immediately after the protected resource is no longer modified to
prevent a possible source of a deadlock.

The change allows the EFL port to prevent an actual dead-lock
situation with some upcoming changes.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::sendMessage):
(CoreIPC::Connection::enqueueIncomingMessage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (133000 => 133001)


--- trunk/Source/WebKit2/ChangeLog	2012-10-31 08:58:58 UTC (rev 133000)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-31 09:10:39 UTC (rev 133001)
@@ -1,3 +1,21 @@
+2012-10-31  Byungwoo Lee  <[email protected]>
+
+        [WK2] Change the scope of locking in CoreIPC::Connection class.
+        https://bugs.webkit.org/show_bug.cgi?id=98998
+
+        Reviewed by Laszlo Gombos.
+
+        Release the m_incomingMessagesLock and m_outgoingMessagesLock mutexes
+        immediately after the protected resource is no longer modified to
+        prevent a possible source of a deadlock.
+
+        The change allows the EFL port to prevent an actual dead-lock
+        situation with some upcoming changes.
+
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::sendMessage):
+        (CoreIPC::Connection::enqueueIncomingMessage):
+
 2012-10-31  Tim Horton  <[email protected]>
 
         Unreviewed, fix header sorting in r132992.

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (133000 => 133001)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-10-31 08:58:58 UTC (rev 133000)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-10-31 09:10:39 UTC (rev 133001)
@@ -304,8 +304,10 @@
             || m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount))
         messageID = messageID.messageIDWithAddedFlags(MessageID::DispatchMessageWhenWaitingForSyncReply);
 
-    MutexLocker locker(m_outgoingMessagesLock);
-    m_outgoingMessages.append(OutgoingMessage(messageID, encoder));
+    {
+        MutexLocker locker(m_outgoingMessagesLock);
+        m_outgoingMessages.append(OutgoingMessage(messageID, encoder));
+    }
     
     // FIXME: We should add a boolean flag so we don't call this when work has already been scheduled.
     m_connectionQueue.dispatch(WTF::bind(&Connection::sendOutgoingMessages, this));
@@ -648,8 +650,10 @@
 
 void Connection::enqueueIncomingMessage(IncomingMessage& incomingMessage)
 {
-    MutexLocker locker(m_incomingMessagesLock);
-    m_incomingMessages.append(incomingMessage);
+    {
+        MutexLocker locker(m_incomingMessagesLock);
+        m_incomingMessages.append(incomingMessage);
+    }
 
     m_clientRunLoop->dispatch(WTF::bind(&Connection::dispatchOneMessage, this));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to