ppsspp/ext/native/thread/executor.h
2018-06-07 14:11:52 -07:00

24 lines
458 B
C++

#pragma once
#include <functional>
namespace threading {
// Stuff that can execute other stuff, like threadpools, should inherit from this.
class Executor {
public:
virtual void Run(std::function<void()> func) = 0;
};
class SameThreadExecutor : public Executor {
public:
void Run(std::function<void()> func) override;
};
class NewThreadExecutor : public Executor {
public:
void Run(std::function<void()> func) override;
};
} // namespace threading