Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Unified Diff: runtime/bin/thread_pool.h

Issue 9141005: Change the thread interface in runtime/platform and use it starting all threads (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/thread_pool.h
diff --git a/runtime/bin/thread_pool.h b/runtime/bin/thread_pool.h
index 10cbba44de042b72411d54c7517472e9b42bda09..3eaa2e4901e04a81666c9ff1179b581e5d520fe1 100644
--- a/runtime/bin/thread_pool.h
+++ b/runtime/bin/thread_pool.h
@@ -9,18 +9,6 @@
#include "platform/globals.h"
#include "platform/thread.h"
-// Declare the OS-specific types ahead of defining the generic classes.
-#if defined(TARGET_OS_LINUX)
-#include "bin/thread_pool_linux.h"
-#elif defined(TARGET_OS_MACOS)
-#include "bin/thread_pool_macos.h"
-#elif defined(TARGET_OS_WINDOWS)
-#include "bin/thread_pool_win.h"
-#else
-#error Unknown target os.
-#endif
-
-
typedef void* Task;
@@ -74,18 +62,20 @@ class ThreadPool {
void InsertTask(Task task);
+ void ThreadTerminated();
+
private:
Task WaitForTask();
- static void* Main(void* args);
+ static void Main(uword args);
TaskQueue queue_;
// TODO(sgjesse): Move the monitor in TaskQueue to ThreadPool and
// obtain it for updating terminate_.
+ dart::Monitor monitor_;
bool terminate_;
int size_; // Number of threads.
TaskHandler task_handler_;
- ThreadPoolData data_;
DISALLOW_COPY_AND_ASSIGN(ThreadPool);
};

Powered by Google App Engine
This is Rietveld 408576698