diff options
| author | amelia squires <[email protected]> | 2025-10-17 03:03:38 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2025-10-17 03:03:38 -0500 |
| commit | 8705ace5b71a090fc6c6ce745b2637c74b277b50 (patch) | |
| tree | 3fd194c07c54ad603b2d5bde401f6b64d75d5e58 /src | |
| parent | 9f42df734f58c805f153afedd87a5bb720618ada (diff) | |
move function oops
Diffstat (limited to 'src')
| -rw-r--r-- | src/thread.c | 18 |
1 files changed, 8 insertions, 10 deletions
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){
|
