From 7322a090355af1989d7a1de0de431b6c89844fe2 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 25 Oct 2018 08:18:13 +0800 Subject: =?UTF-8?q?*=E5=A2=9E=E5=8A=A0lua=E5=AF=BC=E5=87=BA=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/thread/je_lua_thread.cpp | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/lua/modules/thread/je_lua_thread.cpp') diff --git a/src/lua/modules/thread/je_lua_thread.cpp b/src/lua/modules/thread/je_lua_thread.cpp index d086595..9c2cb35 100644 --- a/src/lua/modules/thread/je_lua_thread.cpp +++ b/src/lua/modules/thread/je_lua_thread.cpp @@ -2,7 +2,7 @@ #include "lua/modules/types.h" #include "libjin/jin.h" #include "lua/jin.h" -#include "lua/common/common.h" +#include "lua/common/je_lua_common.h" #include "je_lua_thread.h" namespace JinEngine @@ -22,7 +22,7 @@ namespace JinEngine return proxy->getRef(); } - static int threadRunner(void* t) + LUA_IMPLEMENT int threadRunner(void* t) { ThreadRef ref = *(Ref*)t; lua_State* L = lua_open(); @@ -38,14 +38,14 @@ namespace JinEngine return 0; } - static int l_thread_gc(lua_State* L) + LUA_IMPLEMENT int l_thread_gc(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_THREAD_THREAD); proxy->release(); return 0; } - static int l_start(lua_State* L) + LUA_IMPLEMENT int l_start(lua_State* L) { ThreadRef ref = checkThread(L); bool result = ref->start(&ref); @@ -53,14 +53,14 @@ namespace JinEngine return 1; } - static int l_wait(lua_State* L) + LUA_IMPLEMENT int l_wait(lua_State* L) { ThreadRef ref = checkThread(L); ref->wait(); return 0; } - static int l_send(lua_State* L) + LUA_IMPLEMENT int l_send(lua_State* L) { ThreadRef ref = checkThread(L); int slot = luax_checkinteger(L, 2); @@ -93,7 +93,7 @@ namespace JinEngine return 0; } - static int l_receive(lua_State* L) + LUA_IMPLEMENT int l_receive(lua_State* L) { ThreadRef ref = checkThread(L); int slot = luax_checkinteger(L, 2); @@ -102,7 +102,7 @@ namespace JinEngine return 1; } - static int l_fetch(lua_State* L) + LUA_IMPLEMENT int l_fetch(lua_State* L) { ThreadRef ref = checkThread(L); int slot = luax_checkinteger(L, 2); @@ -136,7 +136,7 @@ namespace JinEngine return 1; } - static int l_demand(lua_State* L) + LUA_IMPLEMENT int l_demand(lua_State* L) { ThreadRef ref = checkThread(L); int slot = luax_checkinteger(L, 2); @@ -171,7 +171,7 @@ namespace JinEngine return 1; } - static int l_remove(lua_State* L) + LUA_IMPLEMENT int l_remove(lua_State* L) { ThreadRef ref = checkThread(L); int slot = luax_checkinteger(L, 2); @@ -179,7 +179,7 @@ namespace JinEngine return 0; } - static int l_getName(lua_State* L) + LUA_IMPLEMENT int l_getName(lua_State* L) { ThreadRef ref = checkThread(L); const char* name = ref->getName(); @@ -187,7 +187,7 @@ namespace JinEngine return 1; } - static int l_isRunning(lua_State* L) + LUA_IMPLEMENT int l_isRunning(lua_State* L) { ThreadRef ref = checkThread(L); bool running = ref->isRunning(); @@ -195,7 +195,7 @@ namespace JinEngine return 1; } - static const luaL_Reg thread_function[] = { + LUA_IMPLEMENT const luaL_Reg thread_function[] = { { "__gc", l_thread_gc }, { "start", l_start }, { "wait", l_wait }, @@ -209,14 +209,14 @@ namespace JinEngine { 0, 0 } }; - static int luaopen_Thread(lua_State* L) + LUA_IMPLEMENT int luaopen_Thread(lua_State* L) { luax_newtype(L, JIN_THREAD_THREAD, thread_function); return 0; } - static int l_newThread(lua_State* L) + LUA_IMPLEMENT int l_newThread(lua_State* L) { const char* name = luax_checkstring(L, 1); const char* code = luax_checkstring(L, 2); @@ -226,20 +226,20 @@ namespace JinEngine return 1; } - static int l_getThread(lua_State* L) + LUA_IMPLEMENT int l_getThread(lua_State* L) { luax_getglobal(L, MODULE_NAME); luax_getfield(L, -1, "_curThread"); return 1; } - static const luaL_Reg f[] = { + LUA_IMPLEMENT const luaL_Reg f[] = { { "newThread", l_newThread }, { "getThread", l_getThread }, { 0, 0 } }; - int luaopen_thread(lua_State* L) + LUA_EXPORT int luaopen_thread(lua_State* L) { luaopen_Thread(L); -- cgit v1.1-26-g67d0