From 1d310e6ecb6e156598337612f16573d9cd284f5e Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 19 Mar 2024 18:06:19 +0100 Subject: fix small internal issue with when hitting timeout on thread kill during thread_cancel() in pthread implementation --- src/cancel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cancel.c b/src/cancel.c index 0a5adb6..d739ff9 100644 --- a/src/cancel.c +++ b/src/cancel.c @@ -156,10 +156,10 @@ static cancel_result thread_cancel_hard( lua_State* L, Lane* s, double secs_, bo #if THREADAPI == THREADAPI_PTHREAD // pthread: make sure the thread is really stopped! // note that this may block forever if the lane doesn't call a cancellation point and pthread doesn't honor PTHREAD_CANCEL_ASYNCHRONOUS - result = THREAD_WAIT( &s->thread, waitkill_timeout_, &s->done_signal, &s->done_lock, &s->status); + result = THREAD_WAIT( &s->thread, waitkill_timeout_, &s->done_signal, &s->done_lock, &s->status) ? CR_Killed : CR_Timeout; if( result == CR_Timeout) { - return luaL_error( L, "force-killed lane failed to terminate within %f second%s", waitkill_timeout_, waitkill_timeout_ > 1 ? "s" : ""); + (void) luaL_error( L, "force-killed lane failed to terminate within %f second%s", waitkill_timeout_, waitkill_timeout_ > 1 ? "s" : ""); } #else (void) waitkill_timeout_; // unused -- cgit v1.2.3-55-g6feb