diff options
| author | amy <[email protected]> | 2025-04-14 14:09:22 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-14 14:09:22 -0500 |
| commit | dd7a8af4050454c3901987bff24a77334f892cc4 (patch) | |
| tree | 48c6107656e14cfbbcbb49424fc3454de850a5db /src/thread.c | |
| parent | 44c68aa7d51ea6b50c442bfbfa4ce11c530d2f7d (diff) | |
| parent | dc7e4527e88ed0c59e17c0ff04c01e1c92136e42 (diff) | |
Merge pull request #1 from ameliasquires/new-config
updates how config values are updated, support for local values when copying states, and annotations
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;
|
