diff options
Diffstat (limited to 'src/cancel.h')
-rw-r--r-- | src/cancel.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/cancel.h b/src/cancel.h index 3112809..e7656ac 100644 --- a/src/cancel.h +++ b/src/cancel.h | |||
@@ -29,15 +29,24 @@ typedef enum | |||
29 | CR_Killed | 29 | CR_Killed |
30 | } cancel_result; | 30 | } cancel_result; |
31 | 31 | ||
32 | typedef enum | ||
33 | { | ||
34 | CO_Invalid = -2, | ||
35 | CO_Hard = -1, | ||
36 | CO_Soft = 0, | ||
37 | CO_Count = LUA_MASKCOUNT, | ||
38 | CO_Line = LUA_MASKLINE, | ||
39 | CO_Call = LUA_MASKCALL, | ||
40 | CO_Ret = LUA_MASKRET, | ||
41 | } CancelOp; | ||
42 | |||
32 | // crc64/we of string "CANCEL_ERROR" generated at http://www.nitrxgen.net/hashgen/ | 43 | // crc64/we of string "CANCEL_ERROR" generated at http://www.nitrxgen.net/hashgen/ |
33 | static DECLARE_CONST_UNIQUE_KEY(CANCEL_ERROR, 0xe97d41626cc97577); // 'cancel_error' sentinel | 44 | static DECLARE_CONST_UNIQUE_KEY(CANCEL_ERROR, 0xe97d41626cc97577); // 'cancel_error' sentinel |
34 | 45 | ||
35 | // crc64/we of string "CANCEL_TEST_KEY" generated at http://www.nitrxgen.net/hashgen/ | 46 | // crc64/we of string "CANCEL_TEST_KEY" generated at http://www.nitrxgen.net/hashgen/ |
36 | static DECLARE_CONST_UNIQUE_KEY(CANCEL_TEST_KEY, 0xe66f5960c57d133a); // used as registry key | 47 | static DECLARE_CONST_UNIQUE_KEY(CANCEL_TEST_KEY, 0xe66f5960c57d133a); // used as registry key |
37 | 48 | ||
38 | void cancel_hook( lua_State* L, lua_Debug* ar); | 49 | cancel_result thread_cancel( lua_State* L, Lane* s, CancelOp op_, double secs_, bool_t force_, double waitkill_timeout_); |
39 | |||
40 | cancel_result thread_cancel( lua_State* L, Lane* s, double secs_, bool_t force_, double waitkill_timeout_); | ||
41 | 50 | ||
42 | static inline int cancel_error( lua_State* L) | 51 | static inline int cancel_error( lua_State* L) |
43 | { | 52 | { |