mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-12-11 23:53:55 +00:00
24 lines
458 B
C++
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
|