aboutsummaryrefslogtreecommitdiff
path: root/src/cancel.h
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-03-20 18:03:00 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2024-03-20 18:03:00 +0100
commit0b13436b835ea96ecdf930a380e9e5c8add8cb45 (patch)
treee286ce8d2dff20cfed685ff1d66312dcae9b5483 /src/cancel.h
parent9b05d1d26d358bf836a7ad0b23c244836cb30a06 (diff)
downloadlanes-0b13436b835ea96ecdf930a380e9e5c8add8cb45.tar.gz
lanes-0b13436b835ea96ecdf930a380e9e5c8add8cb45.tar.bz2
lanes-0b13436b835ea96ecdf930a380e9e5c8add8cb45.zip
C++ migration: ThreadStatus, CancelRequest and CancelResult are enum class
Diffstat (limited to 'src/cancel.h')
-rw-r--r--src/cancel.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cancel.h b/src/cancel.h
index be4d781..9a20774 100644
--- a/src/cancel.h
+++ b/src/cancel.h
@@ -20,18 +20,18 @@ struct Lane; // forward
20/* 20/*
21 * Lane cancellation request modes 21 * Lane cancellation request modes
22 */ 22 */
23enum e_cancel_request 23enum class CancelRequest
24{ 24{
25 CANCEL_NONE, // no pending cancel request 25 None, // no pending cancel request
26 CANCEL_SOFT, // user wants the lane to cancel itself manually on cancel_test() 26 Soft, // user wants the lane to cancel itself manually on cancel_test()
27 CANCEL_HARD // user wants the lane to be interrupted (meaning code won't return from those functions) from inside linda:send/receive calls 27 Hard // user wants the lane to be interrupted (meaning code won't return from those functions) from inside linda:send/receive calls
28}; 28};
29 29
30enum cancel_result 30enum class CancelResult
31{ 31{
32 CR_Timeout, 32 Timeout,
33 CR_Cancelled, 33 Cancelled,
34 CR_Killed 34 Killed
35}; 35};
36 36
37enum CancelOp 37enum CancelOp
@@ -51,7 +51,7 @@ static constexpr UniqueKey CANCEL_ERROR{ 0xe97d41626cc97577ull }; // 'cancel_err
51// crc64/we of string "CANCEL_TEST_KEY" generated at http://www.nitrxgen.net/hashgen/ 51// crc64/we of string "CANCEL_TEST_KEY" generated at http://www.nitrxgen.net/hashgen/
52static constexpr UniqueKey CANCEL_TEST_KEY{ 0xe66f5960c57d133aull }; // used as registry key 52static constexpr UniqueKey CANCEL_TEST_KEY{ 0xe66f5960c57d133aull }; // used as registry key
53 53
54cancel_result thread_cancel( lua_State* L, Lane* s, CancelOp op_, double secs_, bool force_, double waitkill_timeout_); 54CancelResult thread_cancel(lua_State* L, Lane* s, CancelOp op_, double secs_, bool force_, double waitkill_timeout_);
55 55
56static inline int cancel_error( lua_State* L) 56static inline int cancel_error( lua_State* L)
57{ 57{