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

Unified Diff: runtime/bin/thread_pool.h

Issue 9112013: Thread pool changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ 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
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/thread_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/thread_pool.h
diff --git a/runtime/bin/thread_pool.h b/runtime/bin/thread_pool.h
index 9357ba21f60ccb0166860819b70506f1e9bfc319..01eeec00f8b9941f5a15a159e81686dc882ad550 100644
--- a/runtime/bin/thread_pool.h
+++ b/runtime/bin/thread_pool.h
@@ -20,7 +20,7 @@
#endif
-typedef int Task;
+typedef void* Task;
class TaskQueueEntry {
@@ -57,9 +57,13 @@ class TaskQueue {
};
+typedef void* (*ThreadPoolTaskHandler)(void* args);
Mads Ager (google) 2012/01/06 10:56:18 Does the style guide say anything about the placem
Søren Gjesse 2012/01/06 11:24:26 I moved it into class ThreadPool (and changed the
+
+
class ThreadPool {
public:
- explicit ThreadPool(int initial_size = 4) : size_(initial_size) {}
+ ThreadPool(ThreadPoolTaskHandler task_handler, int initial_size = 4)
+ : size_(initial_size), task_handler_(task_handler) {}
void Start();
void Shutdown();
@@ -73,6 +77,7 @@ class ThreadPool {
TaskQueue queue;
int size_; // Number of threads.
+ ThreadPoolTaskHandler task_handler_;
ThreadPoolData data_;
DISALLOW_COPY_AND_ASSIGN(ThreadPool);
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/thread_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698