[Lldb-commits] [lldb] r228179 - Fix synchronization issue in Broadcaster::HijackBroadcaster.

Oleksiy Vyalov ovyalov at google.com
Wed Feb 4 11:42:32 PST 2015


Author: ovyalov
Date: Wed Feb  4 13:42:32 2015
New Revision: 228179

URL: http://llvm.org/viewvc/llvm-project?rev=228179&view=rev
Log:
Fix synchronization issue in Broadcaster::HijackBroadcaster.

Modified:
    lldb/trunk/include/lldb/Core/Broadcaster.h
    lldb/trunk/source/Core/Broadcaster.cpp

Modified: lldb/trunk/include/lldb/Core/Broadcaster.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Broadcaster.h?rev=228179&r1=228178&r2=228179&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Broadcaster.h (original)
+++ lldb/trunk/include/lldb/Core/Broadcaster.h Wed Feb  4 13:42:32 2015
@@ -419,12 +419,7 @@ public:
     HijackBroadcaster (Listener *listener, uint32_t event_mask = UINT32_MAX);
     
     bool
-    IsHijackedForEvent (uint32_t event_mask)
-    {
-        if (m_hijacking_listeners.size() > 0)
-            return (event_mask & m_hijacking_masks.back()) != 0;
-        return false;
-    }
+    IsHijackedForEvent (uint32_t event_mask);
 
     //------------------------------------------------------------------
     /// Restore the state of the Broadcaster from a previous hijack attempt.

Modified: lldb/trunk/source/Core/Broadcaster.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Broadcaster.cpp?rev=228179&r1=228178&r2=228179&view=diff
==============================================================================
--- lldb/trunk/source/Core/Broadcaster.cpp (original)
+++ lldb/trunk/source/Core/Broadcaster.cpp Wed Feb  4 13:42:32 2015
@@ -303,6 +303,16 @@ Broadcaster::HijackBroadcaster (Listener
     return true;
 }
 
+bool
+Broadcaster::IsHijackedForEvent (uint32_t event_mask)
+{
+    Mutex::Locker event_types_locker(m_listeners_mutex);
+
+    if (!m_hijacking_listeners.empty())
+        return (event_mask & m_hijacking_masks.back()) != 0;
+    return false;
+}
+
 void
 Broadcaster::RestoreBroadcaster ()
 {





More information about the lldb-commits mailing list