thread: Add a simple thread executor.

This commit is contained in:
Unknown W. Brackets committed 2018-06-07 14:11:52 -07:00
1 parent 403632b4ca
commit 042256337a
2 files changed
+15 -5

No files matched your search

+6 -1
View File
@@ -1,11 +1,16 @@
#include "thread/executor.h"
#include <functional>
#include <thread>
namespace threading {
void SameThreadExecutor::Run(std::function<void()> func) {
func();
func();
}
void NewThreadExecutor::Run(std::function<void()> func) {
std::thread(func).detach();
}
} // namespace threading