Make Loop and LoopData only hold move-only functions

This commit is contained in:
Alex Hultman
2019-01-23 12:26:33 +01:00
parent 91925ccc37
commit 95478c906f
2 changed files with 10 additions and 8 deletions
+4 -2
View File
@@ -25,6 +25,8 @@
#include "PerMessageDeflate.h"
#include "f2/function2.hpp"
namespace uWS {
struct Loop;
@@ -34,9 +36,9 @@ struct alignas(16) LoopData {
private:
std::mutex deferMutex;
int currentDeferQueue = 0;
std::vector<std::function<void()>> deferQueues[2];
std::vector<fu2::unique_function<void()>> deferQueues[2];
std::function<void(Loop *)> postHandler, preHandler;
fu2::unique_function<void(Loop *)> postHandler, preHandler;
public:
~LoopData() {