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); |