From dc6a275e0498331f799c12b8df118233f60c1e21 Mon Sep 17 00:00:00 2001 From: Dmitry Maluka Date: Mon, 16 Oct 2023 10:45:37 +0200 Subject: [PATCH] Fix non-working lua Lock (#2945) The lock provided to lua as micro.Lock does not really work: an attempt to use it via micro.Lock:Lock() results in an error: Plugin initlua: init:260: attempt to call a non-function object stack traceback: init:260: in main chunk [G]: ? The reason is that the value that is provided to lua is a copy of the mutex, not the mutex itself. Ref #1539 --- cmd/micro/initlua.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/micro/initlua.go b/cmd/micro/initlua.go index 3cbb3b2d0..5acb979d3 100644 --- a/cmd/micro/initlua.go +++ b/cmd/micro/initlua.go @@ -54,7 +54,7 @@ func luaImportMicro() *lua.LTable { ulua.L.SetField(pkg, "Tabs", luar.New(ulua.L, func() *action.TabList { return action.Tabs })) - ulua.L.SetField(pkg, "Lock", luar.New(ulua.L, ulua.Lock)) + ulua.L.SetField(pkg, "Lock", luar.New(ulua.L, &ulua.Lock)) return pkg }