aboutsummaryrefslogtreecommitdiff
path: root/src/lane.hpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-02-05 16:24:35 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2025-02-05 16:24:35 +0100
commit887fc613dd943d1221d5a2a3b96cee37c0d81248 (patch)
tree7151029f79e115d8822291644e11244def30079d /src/lane.hpp
parent05e4cce366cccf92ad88f80695efa548fae187de (diff)
downloadlanes-887fc613dd943d1221d5a2a3b96cee37c0d81248.tar.gz
lanes-887fc613dd943d1221d5a2a3b96cee37c0d81248.tar.bz2
lanes-887fc613dd943d1221d5a2a3b96cee37c0d81248.zip
All enums are [[nodiscard]]
Diffstat (limited to 'src/lane.hpp')
-rw-r--r--src/lane.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lane.hpp b/src/lane.hpp
index 4b0acab..4b5188c 100644
--- a/src/lane.hpp
+++ b/src/lane.hpp
@@ -44,7 +44,7 @@ static constexpr std::string_view kLaneMetatableName{ "Lane" };
44#define kLanesCoreLibName kLanesLibName ".core" 44#define kLanesCoreLibName kLanesLibName ".core"
45 45
46// for cancel() argument 46// for cancel() argument
47enum class WakeLane 47enum class [[nodiscard]] WakeLane
48{ 48{
49 No, 49 No,
50 Yes 50 Yes
@@ -60,7 +60,7 @@ class Lane final
60 Running, Suspended, Waiting: Thread is inside the Lua VM. 60 Running, Suspended, Waiting: Thread is inside the Lua VM.
61 Done, Error, Cancelled: Thread execution is outside the Lua VM. It can be lua_close()d. 61 Done, Error, Cancelled: Thread execution is outside the Lua VM. It can be lua_close()d.
62 */ 62 */
63 enum class Status 63 enum class [[nodiscard]] Status
64 { 64 {
65 Pending, 65 Pending,
66 Running, 66 Running,
@@ -73,7 +73,7 @@ class Lane final
73 }; 73 };
74 using enum Status; 74 using enum Status;
75 75
76 enum class ErrorTraceLevel 76 enum class [[nodiscard]] ErrorTraceLevel
77 { 77 {
78 Minimal, // no error handler function when running the lane body 78 Minimal, // no error handler function when running the lane body
79 Basic, // lane body errors caught by a error handler 79 Basic, // lane body errors caught by a error handler
@@ -163,6 +163,7 @@ class Lane final
163 public: 163 public:
164 164
165 void applyDebugName() const; 165 void applyDebugName() const;
166 [[nodiscard]]
166 CancelResult cancel(CancelOp op_, std::chrono::time_point<std::chrono::steady_clock> until_, WakeLane wakeLane_, int hookCount_); 167 CancelResult cancel(CancelOp op_, std::chrono::time_point<std::chrono::steady_clock> until_, WakeLane wakeLane_, int hookCount_);
167 void closeState() 168 void closeState()
168 { 169 {