aboutsummaryrefslogtreecommitdiff
path: root/src/cancel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cancel.cpp')
-rw-r--r--src/cancel.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp
index 73e50f5..c0867a9 100644
--- a/src/cancel.cpp
+++ b/src/cancel.cpp
@@ -50,7 +50,7 @@ THE SOFTWARE.
50* Called by cancellation hooks and/or pending Linda operations (because then 50* Called by cancellation hooks and/or pending Linda operations (because then
51* the check won't affect performance). 51* the check won't affect performance).
52* 52*
53* Returns CANCEL_SOFT/HARD if any locks are to be exited, and 'cancel_error()' called, 53* Returns CANCEL_SOFT/HARD if any locks are to be exited, and 'raise_cancel_error()' called,
54* to make execution of the lane end. 54* to make execution of the lane end.
55*/ 55*/
56static inline CancelRequest cancel_test(lua_State* L) 56static inline CancelRequest cancel_test(lua_State* L)
@@ -78,13 +78,13 @@ LUAG_FUNC( cancel_test)
78// ################################################################################################ 78// ################################################################################################
79// ################################################################################################ 79// ################################################################################################
80 80
81static void cancel_hook( lua_State* L, [[maybe_unused]] lua_Debug* ar) 81static void cancel_hook(lua_State* L, [[maybe_unused]] lua_Debug* ar)
82{ 82{
83 DEBUGSPEW_CODE( fprintf( stderr, "cancel_hook\n")); 83 DEBUGSPEW_CODE(fprintf(stderr, "cancel_hook\n"));
84 if (cancel_test(L) != CancelRequest::None) 84 if (cancel_test(L) != CancelRequest::None)
85 { 85 {
86 lua_sethook( L, nullptr, 0, 0); 86 lua_sethook(L, nullptr, 0, 0);
87 cancel_error( L); 87 raise_cancel_error(L);
88 } 88 }
89} 89}
90 90
@@ -158,7 +158,7 @@ static CancelResult thread_cancel_hard(lua_State* L, Lane* s, double secs_, bool
158 result = THREAD_WAIT(&s->thread, waitkill_timeout_, &s->done_signal, &s->done_lock, &s->status) ? CancelResult::Killed : CancelResult::Timeout; 158 result = THREAD_WAIT(&s->thread, waitkill_timeout_, &s->done_signal, &s->done_lock, &s->status) ? CancelResult::Killed : CancelResult::Timeout;
159 if (result == CancelResult::Timeout) 159 if (result == CancelResult::Timeout)
160 { 160 {
161 (void) luaL_error( L, "force-killed lane failed to terminate within %f second%s", waitkill_timeout_, waitkill_timeout_ > 1 ? "s" : ""); 161 std::ignore = luaL_error( L, "force-killed lane failed to terminate within %f second%s", waitkill_timeout_, waitkill_timeout_ > 1 ? "s" : "");
162 } 162 }
163#else 163#else
164 (void) waitkill_timeout_; // unused 164 (void) waitkill_timeout_; // unused
@@ -238,7 +238,7 @@ static CancelOp which_op( lua_State* L, int idx_)
238 lua_remove( L, idx_); // argument is processed, remove it 238 lua_remove( L, idx_); // argument is processed, remove it
239 if( op == CO_Invalid) 239 if( op == CO_Invalid)
240 { 240 {
241 luaL_error( L, "invalid hook option %s", str); 241 std::ignore = luaL_error( L, "invalid hook option %s", str);
242 } 242 }
243 return op; 243 return op;
244 } 244 }