Let us start here, from square one. No, from Zero!

This commit is contained in:
smpn2
2022-09-30 22:45:51 +09:00
parent 14215af0d1
commit b7a60638a4
1005 changed files with 303069 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#pragma once
#include <thread>
#include <mutex>
#include <string_view>
namespace script {
struct LuaData;
class Instance {
private:
LuaData *lua = nullptr;
std::thread *thread = nullptr;
std::mutex thread_m;
bool running = false;
bool paused = false;
bool error = false;
public:
Instance(const char *str, bool is_path = true, bool sandbox = false);
~Instance();
void join();
void stop();
void pause();
void resume();
inline bool is_running() {
return running;
}
inline bool is_paused() {
return paused;
}
};
extern thread_local Instance *INSTANCE;
}