diff options
| author | amelia squires <[email protected]> | 2025-04-14 14:03:08 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2025-04-14 14:03:08 -0500 |
| commit | dc7e4527e88ed0c59e17c0ff04c01e1c92136e42 (patch) | |
| tree | 48c6107656e14cfbbcbb49424fc3454de850a5db /src/thread.c | |
| parent | 9c3eea30aeb3c13b6df2288fbd086756a217a04b (diff) | |
config change, local support, overall fixes
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/thread.c b/src/thread.c index db8e54e..a6be01b 100644 --- a/src/thread.c +++ b/src/thread.c @@ -125,8 +125,10 @@ void* handle_thread(void* _args){ lua_setmetatable(L, res_idx);
luaL_loadbuffer(L, args->function->c, args->function->len, "thread");
+ int x = lua_gettop(L);
str_free(args->function);
+ lua_assign_upvalues(L, x);
lua_pushvalue(L, res_idx);
lua_call(L, 1, 0);
@@ -182,9 +184,10 @@ int l_async(lua_State* oL){ lua_gc(L, LUA_GCSTOP);
luaL_openlibs(L);
- lua_getglobal(oL, "_G");
- luaI_deepcopy(oL, L, SKIP_GC);
- lua_set_global_table(L);
+ //lua_getglobal(oL, "_G");
+ //luaI_deepcopy(oL, L, SKIP_GC);
+ //lua_set_global_table(L);
+ luaI_copyvars(oL, L);
struct thread_info* args = calloc(1, sizeof * args);
args->L = L;
|
