mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 13:06:24 +02:00
Common: Get rid of Executor.cpp/h.
There was only one implementation.
This commit is contained in:
1 parent
8c72cc119e
commit
e6aa841b78
12 files changed
+25
-79
No files matched your search
@@ -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<void()> &&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));
|
||||
|
||||
Reference in new issue
Block a user