Move to boost::asio::post

This allows entity_manager to compile with BOOST_ASIO_NO_DEPRECATED set.
It was functionally changed a few years ago, and is identical to the
other behavior.

Change-Id: I639bd43c7743629e7418d3974305eb52517c31b8
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/src/entity_manager.cpp b/src/entity_manager.cpp
index 1544680..f0e1c96 100644
--- a/src/entity_manager.cpp
+++ b/src/entity_manager.cpp
@@ -28,6 +28,7 @@
 #include <boost/algorithm/string/replace.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <boost/asio/io_context.hpp>
+#include <boost/asio/post.hpp>
 #include <boost/asio/steady_timer.hpp>
 #include <boost/container/flat_map.hpp>
 #include <boost/container/flat_set.hpp>
@@ -256,7 +257,7 @@
 
             // todo(james): dig through sdbusplus to find out why we can't
             // delete it in a method call
-            io.post([&objServer, dbusInterface]() mutable {
+            boost::asio::post(io, [&objServer, dbusInterface]() mutable {
                 objServer.remove_interface(dbusInterface);
             });
 
@@ -999,15 +1000,15 @@
 {
     loadOverlays(newConfiguration);
 
-    io.post([systemConfiguration]() {
+    boost::asio::post(io, [systemConfiguration]() {
         if (!writeJsonFiles(systemConfiguration))
         {
             std::cerr << "Error writing json files\n";
         }
     });
 
-    io.post([&instance, count, &timer, newConfiguration, &systemConfiguration,
-             &objServer]() {
+    boost::asio::post(io, [&instance, count, &timer, newConfiguration,
+                           &systemConfiguration, &objServer]() {
         postToDbus(newConfiguration, systemConfiguration, objServer);
         if (count == instance)
         {
@@ -1087,10 +1088,11 @@
 
                 inProgress = false;
 
-                io.post(std::bind_front(
-                    publishNewConfiguration, std::ref(instance), count,
-                    std::ref(timer), std::ref(systemConfiguration),
-                    newConfiguration, std::ref(objServer)));
+                boost::asio::post(
+                    io, std::bind_front(
+                            publishNewConfiguration, std::ref(instance), count,
+                            std::ref(timer), std::ref(systemConfiguration),
+                            newConfiguration, std::ref(objServer)));
             });
         perfScan->run();
     });
@@ -1156,8 +1158,9 @@
             propertiesChangedCallback(systemConfiguration, objServer);
         });
 
-    io.post(
-        [&]() { propertiesChangedCallback(systemConfiguration, objServer); });
+    boost::asio::post(io, [&]() {
+        propertiesChangedCallback(systemConfiguration, objServer);
+    });
 
     entityIface->register_method("ReScan", [&]() {
         propertiesChangedCallback(systemConfiguration, objServer);