diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 15 |
1 files changed, 14 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.214 2002/10/25 20:05:28 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.215 2002/10/25 21:31:28 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -105,6 +105,19 @@ LUA_API int lua_checkstack (lua_State *L, int size) { | |||
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | 107 | ||
| 108 | LUA_API void lua_movethread (lua_State *from, lua_State *to, int n) { | ||
| 109 | int i; | ||
| 110 | lua_lock(to); | ||
| 111 | api_checknelems(from, n); | ||
| 112 | from->top -= n; | ||
| 113 | for (i = 0; i < n; i++) { | ||
| 114 | setobj(to->top, from->top + i); | ||
| 115 | api_incr_top(to); | ||
| 116 | } | ||
| 117 | lua_unlock(to); | ||
| 118 | } | ||
| 119 | |||
| 120 | |||
| 108 | LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { | 121 | LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { |
| 109 | lua_CFunction old; | 122 | lua_CFunction old; |
| 110 | lua_lock(L); | 123 | lua_lock(L); |
