From 4b2003c78a5e4270f384283f72d185cd4a40f30e Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 22 Feb 2024 12:37:01 +1100 Subject: Make property bindings shared amongst all lua threads --- src/app_console/app_console.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/app_console/app_console.cpp') diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp index 33f41306..4e6c97ba 100644 --- a/src/app_console/app_console.cpp +++ b/src/app_console/app_console.cpp @@ -628,8 +628,7 @@ static const char kReplMain[] = "repl:run()\n"; int CmdLua(int argc, char** argv) { - std::unique_ptr context{ - lua::LuaThread::Start(*AppConsole::sServices)}; + auto context = lua::Registry::instance(*AppConsole::sServices).newThread(); if (!context) { return 1; } @@ -652,8 +651,7 @@ int CmdLua(int argc, char** argv) { } int CmdLuaRun(int argc, char** argv) { - std::unique_ptr context{ - lua::LuaThread::Start(*AppConsole::sServices)}; + auto context = lua::Registry::instance(*AppConsole::sServices).newThread(); if (!context) { return 1; } -- cgit v1.2.3 From f9aec8b6906599296417af5414b1c72a3cf53e73 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 22 Feb 2024 14:16:33 +1100 Subject: split the lua thread registry into its own files --- src/app_console/app_console.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/app_console/app_console.cpp') diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp index 4e6c97ba..94a48955 100644 --- a/src/app_console/app_console.cpp +++ b/src/app_console/app_console.cpp @@ -40,7 +40,7 @@ #include "freertos/projdefs.h" #include "haptics.hpp" #include "index.hpp" -#include "lua_thread.hpp" +#include "lua_registry.hpp" #include "memory_resource.hpp" #include "samd.hpp" #include "service_locator.hpp" -- cgit v1.2.3