diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0eb5da521..9f498bc890 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -597,8 +597,6 @@ add_library(Common STATIC
Common/Render/Text/draw_text_uwp.h
Common/System/Display.cpp
Common/System/Display.h
- Common/Thread/Executor.cpp
- Common/Thread/Executor.h
Common/Thread/PrioritizedWorkQueue.cpp
Common/Thread/PrioritizedWorkQueue.h
Common/Thread/ThreadUtil.cpp
diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj
index 8029db0faa..7595b60f80 100644
--- a/Common/Common.vcxproj
+++ b/Common/Common.vcxproj
@@ -523,7 +523,6 @@
-
@@ -860,7 +859,6 @@
-
diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters
index c83818b6bd..dd834136fc 100644
--- a/Common/Common.vcxproj.filters
+++ b/Common/Common.vcxproj.filters
@@ -102,9 +102,6 @@
Thread
-
- Thread
-
Input
@@ -494,9 +491,6 @@
Thread
-
- Thread
-
Input
diff --git a/Common/Net/HTTPServer.cpp b/Common/Net/HTTPServer.cpp
index 1deb45f72c..9eee85d3fb 100644
--- a/Common/Net/HTTPServer.cpp
+++ b/Common/Net/HTTPServer.cpp
@@ -37,11 +37,21 @@
#include "Common/Net/HTTPServer.h"
#include "Common/Net/Sinks.h"
#include "Common/File/FileDescriptor.h"
-#include "Common/Thread/Executor.h"
#include "Common/Buffer.h"
#include "Common/Log.h"
+void NewThreadExecutor::Run(std::function &&func) {
+ threads_.push_back(std::thread(func));
+}
+
+NewThreadExecutor::~NewThreadExecutor() {
+ // If Run was ever called...
+ for (auto &thread : threads_)
+ thread.join();
+ threads_.clear();
+}
+
namespace http {
// Note: charset here helps prevent XSS.
@@ -126,7 +136,7 @@ void Request::Close() {
}
}
-Server::Server(threading::Executor *executor)
+Server::Server(NewThreadExecutor *executor)
: port_(0), executor_(executor) {
RegisterHandler("/", std::bind(&Server::HandleListing, this, std::placeholders::_1));
SetFallbackHandler(std::bind(&Server::Handle404, this, std::placeholders::_1));
diff --git a/Common/Net/HTTPServer.h b/Common/Net/HTTPServer.h
index 9cfdf2fc1e..1a5e1f9b62 100644
--- a/Common/Net/HTTPServer.h
+++ b/Common/Net/HTTPServer.h
@@ -2,10 +2,19 @@
#include
#include