Disable threading
This commit disables threads from bmcweb. They weren't really used,
but bmcweb linked against pthread regardless because of history. This
commit, while small, makes some pretty important changes.
1. libstdc++ shared_ptr now becomes cheaper to increment and decrement
ref counts, as it knows that we only have a single thread.
2. We save about 8k on our compiled size, most likely due to
optimizations the compiler can do around threading assumptions.
Change-Id: Ib9c20aaa2489952728de2ba8b93b24532e7b8c18
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb0ff47..fb32e2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,7 @@
endif ()
# add_definitions(-DBOOST_ASIO_ENABLE_HANDLER_TRACKING)
+add_definitions (-DBOOST_ASIO_DISABLE_THREADS)
add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
add_definitions (-DBOOST_ALL_NO_LIB)
@@ -218,7 +219,6 @@
# bmcweb
add_executable (bmcweb ${WEBSERVER_MAIN} ${HDR_FILES} ${SRC_FILES})
-target_link_libraries (bmcweb pthread)
target_link_libraries (bmcweb ${OPENSSL_LIBRARIES})
target_link_libraries (bmcweb ${ZLIB_LIBRARIES})
target_link_libraries (bmcweb pam)
diff --git a/crow/include/crow/app.h b/crow/include/crow/app.h
index f006a78..78d99df 100644
--- a/crow/include/crow/app.h
+++ b/crow/include/crow/app.h
@@ -6,7 +6,6 @@
#include <future>
#include <memory>
#include <string>
-#include <thread>
#include <utility>
#include "crow/http_request.h"
#include "crow/http_server.h"