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