diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 16:51:33 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 16:51:33 +0200 |
commit | 0d94a88b4de3973ce99fd77c6731c8219444db9e (patch) | |
tree | b3533d50ce5245c45ae31b97e1fc2731df975af4 /src/lane.h | |
parent | 678ee3fe8942ade73a46a1f4ec45e2216471a3f7 (diff) | |
download | lanes-0d94a88b4de3973ce99fd77c6731c8219444db9e.tar.gz lanes-0d94a88b4de3973ce99fd77c6731c8219444db9e.tar.bz2 lanes-0d94a88b4de3973ce99fd77c6731c8219444db9e.zip |
Factorized Lane::cancelSoft/cancelHard → internalCancel
Diffstat (limited to 'src/lane.h')
-rw-r--r-- | src/lane.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -37,8 +37,9 @@ static constexpr RegistryUniqueKey kLaneNameRegKey{ 0xA194E2645C57F6DDull }; | |||
37 | // The chain is ended by '(Lane*)(-1)', not nullptr: 'selfdestructFirst -> ... -> ... -> (-1)' | 37 | // The chain is ended by '(Lane*)(-1)', not nullptr: 'selfdestructFirst -> ... -> ... -> (-1)' |
38 | #define SELFDESTRUCT_END ((Lane*) (-1)) | 38 | #define SELFDESTRUCT_END ((Lane*) (-1)) |
39 | 39 | ||
40 | static constexpr std::string_view kLaneMetatableName{ "Lane" }; | ||
41 | |||
40 | // must be a #define instead of a constexpr to benefit from compile-time string concatenation | 42 | // must be a #define instead of a constexpr to benefit from compile-time string concatenation |
41 | #define kLaneMetatableName "Lane" | ||
42 | #define kLanesLibName "lanes" | 43 | #define kLanesLibName "lanes" |
43 | #define kLanesCoreLibName kLanesLibName ".core" | 44 | #define kLanesCoreLibName kLanesLibName ".core" |
44 | 45 | ||
@@ -140,8 +141,7 @@ class Lane | |||
140 | 141 | ||
141 | private: | 142 | private: |
142 | 143 | ||
143 | [[nodiscard]] CancelResult cancelHard(std::chrono::time_point<std::chrono::steady_clock> until_, bool wakeLane_); | 144 | [[nodiscard]] CancelResult internalCancel(CancelRequest rq_, std::chrono::time_point<std::chrono::steady_clock> until_, bool wakeLane_); |
144 | [[nodiscard]] CancelResult cancelSoft(std::chrono::time_point<std::chrono::steady_clock> until_, bool wakeLane_); | ||
145 | 145 | ||
146 | public: | 146 | public: |
147 | 147 | ||
@@ -192,5 +192,5 @@ class Lane | |||
192 | // | 192 | // |
193 | [[nodiscard]] inline Lane* ToLane(lua_State* const L_, StackIndex const i_) | 193 | [[nodiscard]] inline Lane* ToLane(lua_State* const L_, StackIndex const i_) |
194 | { | 194 | { |
195 | return *(static_cast<Lane**>(luaL_checkudata(L_, i_, kLaneMetatableName))); | 195 | return *(static_cast<Lane**>(luaL_checkudata(L_, i_, kLaneMetatableName.data()))); |
196 | } | 196 | } |