mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-26 11:48:36 +01:00
thread: Add a simple thread executor.
This commit is contained in:
1 parent
403632b4ca
commit
042256337a
2 files changed
+15
-5
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user