Title: [166944] trunk/Source/bmalloc
- Revision
- 166944
- Author
- gga...@apple.com
- Date
- 2014-04-08 12:26:17 -0700 (Tue, 08 Apr 2014)
Log Message
2014-04-08 Geoffrey Garen <gga...@apple.com>
Removed an unused file.
Unreviewed.
* bmalloc/AsyncTask.cpp: Removed.
Modified Paths
Removed Paths
Diff
Modified: trunk/Source/bmalloc/ChangeLog (166943 => 166944)
--- trunk/Source/bmalloc/ChangeLog 2014-04-08 19:12:37 UTC (rev 166943)
+++ trunk/Source/bmalloc/ChangeLog 2014-04-08 19:26:17 UTC (rev 166944)
@@ -1,3 +1,11 @@
+2014-04-08 Geoffrey Garen <gga...@apple.com>
+
+ Removed an unused file.
+
+ Unreviewed.
+
+ * bmalloc/AsyncTask.cpp: Removed.
+
2014-04-07 Geoffrey Garen <gga...@apple.com>
Build bmalloc on Mac
Deleted: trunk/Source/bmalloc/bmalloc/AsyncTask.cpp (166943 => 166944)
--- trunk/Source/bmalloc/bmalloc/AsyncTask.cpp 2014-04-08 19:12:37 UTC (rev 166943)
+++ trunk/Source/bmalloc/bmalloc/AsyncTask.cpp 2014-04-08 19:26:17 UTC (rev 166944)
@@ -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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes