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

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: Created 8 years, 12 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..6999aff2e3bf89daeef93e768c338ecb2a07fc2c 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 {
@@ -59,7 +59,8 @@ class TaskQueue {
class ThreadPool {
public:
- explicit ThreadPool(int initial_size = 4) : size_(initial_size) {}
+ ThreadPool(void* (*task_handler)(void* args), int initial_size = 4)
+ : size_(initial_size), task_handler_(task_handler) {}
void Start();
void Shutdown();
@@ -73,6 +74,7 @@ class ThreadPool {
TaskQueue queue;
int size_; // Number of threads.
+ void* (*task_handler_)(void* args);
Mads Ager (google) 2012/01/06 10:15:18 Let's typedef this type and the use a named type i
Søren Gjesse 2012/01/06 10:41:15 Sure - looks nicer.
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