passing TaskPtr to executor in scheduler to ensure when the
callback is envoked, the Task object is still there
diff --git a/scheduler/task.h b/scheduler/task.h
index 41e4438..11a9fa6 100644
--- a/scheduler/task.h
+++ b/scheduler/task.h
@@ -32,6 +32,7 @@
 
 #include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
 #include <sys/time.h>
 
 //////////////////////////////////////////////////
@@ -49,7 +50,7 @@
 /**
  * @brief Base class for a task
  */
-class Task
+class Task : public boost::enable_shared_from_this<Task>
 {
 public:
   // callback of this task