diff options
Diffstat (limited to '')
-rw-r--r-- | src/lanes_private.h | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/lanes_private.h b/src/lanes_private.h index 16c178d..ac05129 100644 --- a/src/lanes_private.h +++ b/src/lanes_private.h | |||
@@ -2,16 +2,7 @@ | |||
2 | #define __lanes_private_h__ 1 | 2 | #define __lanes_private_h__ 1 |
3 | 3 | ||
4 | #include "uniquekey.h" | 4 | #include "uniquekey.h" |
5 | 5 | #include "cancel.h" | |
6 | /* | ||
7 | * Lane cancellation request modes | ||
8 | */ | ||
9 | enum e_cancel_request | ||
10 | { | ||
11 | CANCEL_NONE, // no pending cancel request | ||
12 | CANCEL_SOFT, // user wants the lane to cancel itself manually on cancel_test() | ||
13 | CANCEL_HARD // user wants the lane to be interrupted (meaning code won't return from those functions) from inside linda:send/receive calls | ||
14 | }; | ||
15 | 6 | ||
16 | // NOTE: values to be changed by either thread, during execution, without | 7 | // NOTE: values to be changed by either thread, during execution, without |
17 | // locking, are marked "volatile" | 8 | // locking, are marked "volatile" |
@@ -86,12 +77,6 @@ typedef struct s_Lane Lane; | |||
86 | // | 77 | // |
87 | #define lua_toLane( L, i) (*((Lane**) luaL_checkudata( L, i, "Lane"))) | 78 | #define lua_toLane( L, i) (*((Lane**) luaL_checkudata( L, i, "Lane"))) |
88 | 79 | ||
89 | // crc64/we of string "CANCEL_ERROR" generated at http://www.nitrxgen.net/hashgen/ | ||
90 | static DECLARE_CONST_UNIQUE_KEY(CANCEL_ERROR, 0xe97d41626cc97577); // 'cancel_error' sentinel | ||
91 | |||
92 | // crc64/we of string "CANCEL_TEST_KEY" generated at http://www.nitrxgen.net/hashgen/ | ||
93 | static DECLARE_CONST_UNIQUE_KEY(CANCEL_TEST_KEY, 0xe66f5960c57d133a); // used as registry key | ||
94 | |||
95 | static inline Lane* get_lane_from_registry( lua_State* L) | 80 | static inline Lane* get_lane_from_registry( lua_State* L) |
96 | { | 81 | { |
97 | Lane* s; | 82 | Lane* s; |
@@ -104,11 +89,4 @@ static inline Lane* get_lane_from_registry( lua_State* L) | |||
104 | return s; | 89 | return s; |
105 | } | 90 | } |
106 | 91 | ||
107 | static inline int cancel_error( lua_State* L) | ||
108 | { | ||
109 | STACK_GROW( L, 1); | ||
110 | push_unique_key( L, CANCEL_ERROR); // special error value | ||
111 | return lua_error( L); // doesn't return | ||
112 | } | ||
113 | |||
114 | #endif // __lanes_private_h__ \ No newline at end of file | 92 | #endif // __lanes_private_h__ \ No newline at end of file |