2014-04-08 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2014 19:26:17 +0000 (19:26 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2014 19:26:17 +0000 (19:26 +0000)
        Removed an unused file.

        Unreviewed.

        * bmalloc/AsyncTask.cpp: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166944 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/AsyncTask.cpp [deleted file]

index a32c243..161bdf8 100644 (file)
@@ -1,3 +1,11 @@
+2014-04-08  Geoffrey Garen  <ggaren@apple.com>
+
+        Removed an unused file.
+
+        Unreviewed.
+
+        * bmalloc/AsyncTask.cpp: Removed.
+
 2014-04-07  Geoffrey Garen  <ggaren@apple.com>
 
         Build bmalloc on Mac
diff --git a/Source/bmalloc/bmalloc/AsyncTask.cpp b/Source/bmalloc/bmalloc/AsyncTask.cpp
deleted file mode 100644 (file)
index afa3fe6..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "AsyncTask.h"
-#include "NoInline.h"
-
-namespace bmalloc {
-
-template<typename Function>
-NO_INLINE void AsyncTask<Function>::runSlowCase()
-{
-    State oldState = m_state.exchange(Signaled);
-    if (oldState == Signaled || oldState == Running)
-        return;
-
-    if (oldState == Sleeping) {
-        m_condition.notify_one();
-        return;
-    }
-
-    ASSERT(oldState == Exited);
-    pthread_create(&m_thread, nullptr, &pthreadEntryPoint, this);
-    pthread_detach(m_thread);
-}
-
-template<typename Function>
-void* AsyncTask<Function>::pthreadEntryPoint(void* asyncTask)
-{
-    static_cast<AsyncTask*>(asyncTask)->entryPoint();
-    return nullptr;
-}
-
-template<typename Function>
-void AsyncTask<Function>::entryPoint()
-{
-    State expectedState;
-    while (1) {
-        expectedState = Signaled;
-        if (m_state.compare_exchange_weak(expectedState, Running)) {
-            m_function();
-            continue;
-        }
-
-        expectedState = Running;
-        if (m_state.compare_exchange_weak(expectedState, Sleeping)) {
-            std::mutex dummy; // No need for a real mutex because there's only one waiting thread.
-            std::unique_lock<std::mutex> lock(dummy);
-            m_condition.wait_for(lock, std::chrono::milliseconds(2), [=]() { return this->m_state != Sleeping; });
-            continue;
-        }
-
-        expectedState = Sleeping;
-        if (m_state.compare_exchange_weak(expectedState, Exited))
-            break;
-    }
-}
-
-} // namespace bmalloc