diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-11 17:24:30 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-11 17:24:30 +0200 |
commit | 740b820e429cf7c856f2f305b6fc5b6fd969f3b3 (patch) | |
tree | ce885dc8200ad8c7a1f6b3506db9ceedc3cc9df7 /src/lane.h | |
parent | 5f5b287b4548cb21fde9ae451392d82e64cc5de7 (diff) | |
download | lanes-740b820e429cf7c856f2f305b6fc5b6fd969f3b3.tar.gz lanes-740b820e429cf7c856f2f305b6fc5b6fd969f3b3.tar.bz2 lanes-740b820e429cf7c856f2f305b6fc5b6fd969f3b3.zip |
Move some cancel-related code around
Diffstat (limited to 'src/lane.h')
-rw-r--r-- | src/lane.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -120,6 +120,14 @@ class Lane | |||
120 | Lane(Universe* U_, lua_State* L_, ErrorTraceLevel errorTraceLevel_); | 120 | Lane(Universe* U_, lua_State* L_, ErrorTraceLevel errorTraceLevel_); |
121 | ~Lane(); | 121 | ~Lane(); |
122 | 122 | ||
123 | private: | ||
124 | |||
125 | [[nodiscard]] CancelResult cancelHard(std::chrono::time_point<std::chrono::steady_clock> until_, bool wakeLane_); | ||
126 | [[nodiscard]] CancelResult cancelSoft(std::chrono::time_point<std::chrono::steady_clock> until_, bool wakeLane_); | ||
127 | |||
128 | public: | ||
129 | |||
130 | CancelResult cancel(CancelOp op_, int hookCount_, std::chrono::time_point<std::chrono::steady_clock> until_, bool wakeLane_); | ||
123 | void changeDebugName(int const nameIdx_); | 131 | void changeDebugName(int const nameIdx_); |
124 | void close() { lua_State* _L{ L }; L = nullptr; lua_close(_L); } | 132 | void close() { lua_State* _L{ L }; L = nullptr; lua_close(_L); } |
125 | [[nodiscard]] std::string_view errorTraceLevelString() const; | 133 | [[nodiscard]] std::string_view errorTraceLevelString() const; |
@@ -137,7 +145,7 @@ class Lane | |||
137 | 145 | ||
138 | // To allow free-running threads (longer lifespan than the handle's) | 146 | // To allow free-running threads (longer lifespan than the handle's) |
139 | // 'Lane' are malloc/free'd and the handle only carries a pointer. | 147 | // 'Lane' are malloc/free'd and the handle only carries a pointer. |
140 | // This is not deep userdata since the handle's not portable among lanes. | 148 | // This is not deep userdata since the handle is not portable among lanes. |
141 | // | 149 | // |
142 | [[nodiscard]] inline Lane* ToLane(lua_State* L_, int i_) | 150 | [[nodiscard]] inline Lane* ToLane(lua_State* L_, int i_) |
143 | { | 151 | { |