diff options
Diffstat (limited to 'core/src/xmake/thread/thread_exit.c')
| -rw-r--r-- | core/src/xmake/thread/thread_exit.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/core/src/xmake/thread/thread_exit.c b/core/src/xmake/thread/thread_exit.c index 9d2c8e908..ca495d4a5 100644 --- a/core/src/xmake/thread/thread_exit.c +++ b/core/src/xmake/thread/thread_exit.c @@ -22,8 +22,8 @@ /* ////////////////////////////////////////////////////////////////////////////////////// * trace */ -#define TB_TRACE_MODULE_NAME "thread" -#define TB_TRACE_MODULE_DEBUG (0) +#define TB_TRACE_MODULE_NAME "thread" +#define TB_TRACE_MODULE_DEBUG (0) /* ////////////////////////////////////////////////////////////////////////////////////// * includes @@ -33,26 +33,23 @@ /* ////////////////////////////////////////////////////////////////////////////////////// * implementation */ -tb_int_t xm_thread_exit(lua_State* lua) -{ - // check +tb_int_t xm_thread_exit(lua_State *lua) { tb_assert_and_check_return_val(lua, 0); // is pointer? - if (!xm_lua_ispointer(lua, 1)) + if (!xm_lua_ispointer(lua, 1)) { return 0; + } // get thread - xm_thread_t* thread = (xm_thread_t*)xm_lua_topointer(lua, 1); + xm_thread_t *thread = (xm_thread_t *)xm_lua_topointer(lua, 1); tb_check_return_val(thread, 0); // exit thread - if (thread) - { + if (thread) { tb_string_exit(&thread->callback); tb_string_exit(&thread->callinfo); - if (thread->handle) - { + if (thread->handle) { tb_thread_exit(thread->handle); thread->handle = tb_null; } @@ -61,4 +58,3 @@ tb_int_t xm_thread_exit(lua_State* lua) lua_pushboolean(lua, tb_true); return 1; } - |
