Diff
Modified: trunk/Source/WTF/ChangeLog (161163 => 161164)
--- trunk/Source/WTF/ChangeLog 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WTF/ChangeLog 2013-12-31 02:05:38 UTC (rev 161164)
@@ -1,3 +1,17 @@
+2013-12-30 Anders Carlsson <[email protected]>
+
+ Replace yield() and pauseBriefly() with std::this_thread::yield()
+ https://bugs.webkit.org/show_bug.cgi?id=126105
+
+ Reviewed by Sam Weinig.
+
+ * wtf/ByteSpinLock.h:
+ (WTF::ByteSpinLock::lock):
+ * wtf/Threading.h:
+ * wtf/ThreadingPrimitives.h:
+ * wtf/ThreadingPthreads.cpp:
+ * wtf/ThreadingWin.cpp:
+
2013-12-30 Sam Weinig <[email protected]>
Remove unnecessary non-const overload in IteratorPair
Modified: trunk/Source/WTF/wtf/ByteSpinLock.h (161163 => 161164)
--- trunk/Source/WTF/wtf/ByteSpinLock.h 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WTF/wtf/ByteSpinLock.h 2013-12-31 02:05:38 UTC (rev 161164)
@@ -26,11 +26,11 @@
#ifndef ByteSpinLock_h
#define ByteSpinLock_h
+#include <thread>
#include <wtf/Assertions.h>
#include <wtf/Atomics.h>
#include <wtf/Locker.h>
#include <wtf/Noncopyable.h>
-#include <wtf/ThreadingPrimitives.h>
namespace WTF {
@@ -45,7 +45,7 @@
void lock()
{
while (!weakCompareAndSwap(&m_lock, 0, 1))
- pauseBriefly();
+ std::this_thread::yield();
memoryBarrierAfterLock();
}
Modified: trunk/Source/WTF/wtf/Threading.h (161163 => 161164)
--- trunk/Source/WTF/wtf/Threading.h 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WTF/wtf/Threading.h 2013-12-31 02:05:38 UTC (rev 161164)
@@ -100,8 +100,6 @@
WTF_EXPORT_PRIVATE int waitForThreadCompletion(ThreadIdentifier);
WTF_EXPORT_PRIVATE void detachThread(ThreadIdentifier);
-WTF_EXPORT_PRIVATE void yield();
-
WTF_EXPORT_PRIVATE void lockAtomicallyInitializedStaticMutex();
WTF_EXPORT_PRIVATE void unlockAtomicallyInitializedStaticMutex();
@@ -112,6 +110,5 @@
using WTF::currentThread;
using WTF::detachThread;
using WTF::waitForThreadCompletion;
-using WTF::yield;
#endif // Threading_h
Modified: trunk/Source/WTF/wtf/ThreadingPrimitives.h (161163 => 161164)
--- trunk/Source/WTF/wtf/ThreadingPrimitives.h 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WTF/wtf/ThreadingPrimitives.h 2013-12-31 02:05:38 UTC (rev 161164)
@@ -130,22 +130,12 @@
WTF_EXPORT_PRIVATE DWORD absoluteTimeToWaitTimeoutInterval(double absoluteTime);
#endif
-inline void pauseBriefly()
-{
-#if OS(WINDOWS)
- Sleep(0);
-#else
- sched_yield();
-#endif
-}
-
} // namespace WTF
using WTF::Mutex;
using WTF::MutexLocker;
using WTF::MutexTryLocker;
using WTF::ThreadCondition;
-using WTF::pauseBriefly;
#if OS(WINDOWS)
using WTF::absoluteTimeToWaitTimeoutInterval;
Modified: trunk/Source/WTF/wtf/ThreadingPthreads.cpp (161163 => 161164)
--- trunk/Source/WTF/wtf/ThreadingPthreads.cpp 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WTF/wtf/ThreadingPthreads.cpp 2013-12-31 02:05:38 UTC (rev 161164)
@@ -303,11 +303,6 @@
threadMap().remove(threadID);
}
-void yield()
-{
- sched_yield();
-}
-
ThreadIdentifier currentThread()
{
ThreadIdentifier id = ThreadIdentifierData::identifier();
Modified: trunk/Source/WTF/wtf/ThreadingWin.cpp (161163 => 161164)
--- trunk/Source/WTF/wtf/ThreadingWin.cpp 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WTF/wtf/ThreadingWin.cpp 2013-12-31 02:05:38 UTC (rev 161164)
@@ -284,11 +284,6 @@
clearThreadHandleForIdentifier(threadID);
}
-void yield()
-{
- ::Sleep(1);
-}
-
ThreadIdentifier currentThread()
{
return static_cast<ThreadIdentifier>(GetCurrentThreadId());
Modified: trunk/Source/WebCore/ChangeLog (161163 => 161164)
--- trunk/Source/WebCore/ChangeLog 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WebCore/ChangeLog 2013-12-31 02:05:38 UTC (rev 161164)
@@ -1,3 +1,13 @@
+2013-12-30 Anders Carlsson <[email protected]>
+
+ Replace yield() and pauseBriefly() with std::this_thread::yield()
+ https://bugs.webkit.org/show_bug.cgi?id=126105
+
+ Reviewed by Sam Weinig.
+
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::interrupt):
+
2013-12-30 Andreas Kling <[email protected]>
Rename createRenderObject() to createRenderer().
Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp (161163 => 161164)
--- trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp 2013-12-31 01:46:32 UTC (rev 161163)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp 2013-12-31 02:05:38 UTC (rev 161164)
@@ -32,6 +32,7 @@
#include "SQLiteFileSystem.h"
#include "SQLiteStatement.h"
#include <sqlite3.h>
+#include <thread>
#include <wtf/Threading.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
@@ -140,7 +141,7 @@
if (!m_db)
return;
sqlite3_interrupt(m_db);
- yield();
+ std::this_thread::yield();
}
m_lockingMutex.unlock();