Index: /trunk/FACT++/src/temperature.cc
===================================================================
--- /trunk/FACT++/src/temperature.cc	(revision 16728)
+++ /trunk/FACT++/src/temperature.cc	(revision 16729)
@@ -3,5 +3,4 @@
 #endif
 
-#include <boost/bind.hpp>
 #include <boost/array.hpp>
 
@@ -15,4 +14,5 @@
 #include "Event.h"
 #include "StateMachineDim.h"
+#include "StateMachineAsio.h"
 #include "Connection.h"
 #include "LocalControl.h"
@@ -319,5 +319,5 @@
 
 template <class T, class S>
-class StateMachinePowerControl : public T, public ba::io_service, public ba::io_service::work
+class StateMachinePowerControl : public StateMachineAsio<T>
 {
 private:
@@ -358,11 +358,4 @@
     int Execute()
     {
-        // Dispatch (execute) at most one handler from the queue. In contrary
-        // to run_one(), it doesn't wait until a handler is available
-        // which can be dispatched, so poll_one() might return with 0
-        // handlers dispatched. The handlers are always dispatched/executed
-        // synchronously, i.e. within the call to poll_one()
-        poll_one();
-
         return fPower.GetState();
     }
@@ -371,14 +364,6 @@
 public:
     StateMachinePowerControl(ostream &out=cout) :
-        T(out, "TEMPERATURE"), ba::io_service::work(static_cast<ba::io_service&>(*this)),
-        fPower(*this, *this)
-    {
-        // ba::io_service::work is a kind of keep_alive for the loop.
-        // It prevents the io_service to go to stopped state, which
-        // would prevent any consecutive calls to run()
-        // or poll() to do nothing. reset() could also revoke to the
-        // previous state but this might introduce some overhead of
-        // deletion and creation of threads and more.
-
+        StateMachineAsio<T>(out, "TEMPERATURE"), fPower(*this, *this)
+    {
         // State names
         T::AddStateName(Temperature::State::kDisconnected, "NoConnection",
