aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/thread/je_lua_thread.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-12 22:23:35 +0800
committerchai <chaifix@163.com>2018-11-12 22:23:35 +0800
commitc7e59fb376453e5abad8c862b52eb0f4c7ba829b (patch)
treecaefc559396525f6521ad8ff8c4f7f3f035942c2 /src/lua/modules/thread/je_lua_thread.cpp
parentaf62f267a24091a16cbafe844d59cdbd4e78f5b1 (diff)
*修改结构
Diffstat (limited to 'src/lua/modules/thread/je_lua_thread.cpp')
-rw-r--r--src/lua/modules/thread/je_lua_thread.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/lua/modules/thread/je_lua_thread.cpp b/src/lua/modules/thread/je_lua_thread.cpp
index 8b8d1d5..290de6e 100644
--- a/src/lua/modules/thread/je_lua_thread.cpp
+++ b/src/lua/modules/thread/je_lua_thread.cpp
@@ -193,22 +193,22 @@ namespace JinEngine
return 1;
}
- LUA_IMPLEMENT const luaL_Reg thread_function[] = {
- { "__gc", l_thread_gc },
- { "start", l_start },
- { "wait", l_wait },
- { "send", l_send },
- { "receive", l_receive },
- { "fetch", l_fetch },
- { "demand", l_demand },
- { "remove", l_remove },
- { "getName", l_getName },
- { "isRunning", l_isRunning },
- { 0, 0 }
- };
-
LUA_IMPLEMENT int luaopen_Thread(lua_State* L)
{
+ luaL_Reg thread_function[] = {
+ { "__gc", l_thread_gc },
+ { "start", l_start },
+ { "wait", l_wait },
+ { "send", l_send },
+ { "receive", l_receive },
+ { "fetch", l_fetch },
+ { "demand", l_demand },
+ { "remove", l_remove },
+ { "getName", l_getName },
+ { "isRunning", l_isRunning },
+ { 0, 0 }
+ };
+
luax_newtype(L, JIN_THREAD_THREAD, thread_function);
return 0;
@@ -231,16 +231,15 @@ namespace JinEngine
return 1;
}
- LUA_IMPLEMENT const luaL_Reg f[] = {
- { "newThread", l_newThread },
- { "getThread", l_getThread },
- { 0, 0 }
- };
-
LUA_EXPORT int luaopen_thread(lua_State* L)
{
luaopen_Thread(L);
-
+
+ luaL_Reg f[] = {
+ { "newThread", l_newThread },
+ { "getThread", l_getThread },
+ { 0, 0 }
+ };
luax_newlib(L, f);
return 1;