Remove threads

This converts phosphor-pid-control into an async
single threaded application. The reason for doing this
is on our systems phosphor-pid-control had the largest
VSZ when viewed under top. Before this patch the VSZ
was at 50720, after it is at 7760.

Tested-by: Could still interact with all interfaces
under rest-dbus and sensor override worked to ramp fans
when changing cpu temps.

Change-Id: Ie0a837bdf0d1b1df61dc7aff87e5d503b9e0e875
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/pid/pidloop.hpp b/pid/pidloop.hpp
new file mode 100644
index 0000000..3a67954
--- /dev/null
+++ b/pid/pidloop.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "pid/zone.hpp"
+
+#include <boost/asio/steady_timer.hpp>
+
+/**
+ * Main pid control loop for a given zone.
+ * This function calls itself indefinitely in an async loop to calculate
+ * fan outputs based on thermal inputs.
+ *
+ * @param[in] zone - ptr to the PIDZone for this loop.
+ * @param[in] timer - boost timer used for async callback.
+ * @param[in] first - boolean to denote if initialization needs to be run.
+ * @param[in] ms100cnt - loop timer counter.
+ */
+void pidControlLoop(PIDZone* zone, boost::asio::steady_timer& timer,
+                    bool first = true, int ms100cnt = 0);