[Webkit-unassigned] [Bug 101337] [Qt] NonSharedCharacterBreakIterator leads to CRASH() in configurations that do not have COMPARE_AND_SWAP enabled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 6 05:21:56 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=101337





--- Comment #1 from Cedric Hombourger <chombourger at mvista.com>  2012-11-06 05:23:28 PST ---
Adding compareAndSwapNonSharedCharacterBreakIterator() to Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp

+    static inline bool compareAndSwapNonSharedCharacterBreakIterator(TextBreakIterator* expected, TextBreakIterator* newV
+    {
+#if ENABLE(COMPARE_AND_SWAP)
+        return weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), expected, newValue);
+#else
+        DEFINE_STATIC_LOCAL(QMutex, nonSharedCharacterBreakIteratorMutex, ());
+        QMutexLocker locker(&nonSharedCharacterBreakIteratorMutex);
+        if (nonSharedCharacterBreakIterator != expected)
+            return false;
+        nonSharedCharacterBreakIterator = newValue;
+        return true;
+#endif
+    }

and use from:

NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length)
NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list