diff options
Diffstat (limited to 'src/lua/modules/thread/je_lua_thread.cpp')
-rw-r--r-- | src/lua/modules/thread/je_lua_thread.cpp | 41 |
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; |