From 8705ace5b71a090fc6c6ce745b2637c74b277b50 Mon Sep 17 00:00:00 2001 From: amelia squires Date: Fri, 17 Oct 2025 03:03:38 -0500 Subject: move function oops --- src/thread.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/thread.c b/src/thread.c index 1964ad6..add1287 100644 --- a/src/thread.c +++ b/src/thread.c @@ -288,33 +288,31 @@ int _thread_clean(lua_State* L){ return 0; } - -int _thread_close(lua_State* L){ -#ifdef SUPPORTS_PTHREAD_CANCEL - +int _thread_kill(lua_State* L){ lua_pushstring(L, "_"); lua_gettable(L, 1); struct thread_info* info = lua_touserdata(L, -1); - if(info->tid != 0) pthread_cancel(info->tid); + if(info->tid != 0) pthread_kill(info->tid, SIGUSR1); info->tid = 0; return 0; -#else - return _thread_kill(L); -#endif } +int _thread_close(lua_State* L){ +#ifdef SUPPORTS_PTHREAD_CANCEL -int _thread_kill(lua_State* L){ lua_pushstring(L, "_"); lua_gettable(L, 1); struct thread_info* info = lua_touserdata(L, -1); - if(info->tid != 0) pthread_kill(info->tid, SIGUSR1); + if(info->tid != 0) pthread_cancel(info->tid); info->tid = 0; return 0; +#else + return _thread_kill(L); +#endif } int l_async(lua_State* oL){ -- cgit v1.2.3