diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-20 09:09:27 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-20 09:09:27 +0100 |
commit | 0b516e9490b51bdd15c347fcda35b5dbb06b4829 (patch) | |
tree | 33e16fe3a143fa6dcfe3d4b57f0b731c8e414652 /src/cancel.cpp | |
parent | f707ad2568e6bfb8f34496ce647d0fd153723448 (diff) | |
download | lanes-0b516e9490b51bdd15c347fcda35b5dbb06b4829.tar.gz lanes-0b516e9490b51bdd15c347fcda35b5dbb06b4829.tar.bz2 lanes-0b516e9490b51bdd15c347fcda35b5dbb06b4829.zip |
C++ migration: bool_t → bool
Diffstat (limited to 'src/cancel.cpp')
-rw-r--r-- | src/cancel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp index 20c30f8..0f22550 100644 --- a/src/cancel.cpp +++ b/src/cancel.cpp | |||
@@ -50,7 +50,7 @@ THE SOFTWARE. | |||
50 | * Called by cancellation hooks and/or pending Linda operations (because then | 50 | * Called by cancellation hooks and/or pending Linda operations (because then |
51 | * the check won't affect performance). | 51 | * the check won't affect performance). |
52 | * | 52 | * |
53 | * Returns TRUE if any locks are to be exited, and 'cancel_error()' called, | 53 | * Returns CANCEL_SOFT/HARD if any locks are to be exited, and 'cancel_error()' called, |
54 | * to make execution of the lane end. | 54 | * to make execution of the lane end. |
55 | */ | 55 | */ |
56 | static inline enum e_cancel_request cancel_test( lua_State* L) | 56 | static inline enum e_cancel_request cancel_test( lua_State* L) |
@@ -112,7 +112,7 @@ static void cancel_hook( lua_State* L, lua_Debug* ar) | |||
112 | 112 | ||
113 | // ################################################################################################ | 113 | // ################################################################################################ |
114 | 114 | ||
115 | static cancel_result thread_cancel_soft( Lane* s, double secs_, bool_t wake_lindas_) | 115 | static cancel_result thread_cancel_soft( Lane* s, double secs_, bool wake_lindas_) |
116 | { | 116 | { |
117 | s->cancel_request = CANCEL_SOFT; // it's now signaled to stop | 117 | s->cancel_request = CANCEL_SOFT; // it's now signaled to stop |
118 | // negative timeout: we don't want to truly abort the lane, we just want it to react to cancel_test() on its own | 118 | // negative timeout: we don't want to truly abort the lane, we just want it to react to cancel_test() on its own |
@@ -130,7 +130,7 @@ static cancel_result thread_cancel_soft( Lane* s, double secs_, bool_t wake_lind | |||
130 | 130 | ||
131 | // ################################################################################################ | 131 | // ################################################################################################ |
132 | 132 | ||
133 | static cancel_result thread_cancel_hard( lua_State* L, Lane* s, double secs_, bool_t force_, double waitkill_timeout_) | 133 | static cancel_result thread_cancel_hard( lua_State* L, Lane* s, double secs_, bool force_, double waitkill_timeout_) |
134 | { | 134 | { |
135 | cancel_result result; | 135 | cancel_result result; |
136 | 136 | ||
@@ -175,7 +175,7 @@ static cancel_result thread_cancel_hard( lua_State* L, Lane* s, double secs_, bo | |||
175 | 175 | ||
176 | // ################################################################################################ | 176 | // ################################################################################################ |
177 | 177 | ||
178 | cancel_result thread_cancel( lua_State* L, Lane* s, CancelOp op_, double secs_, bool_t force_, double waitkill_timeout_) | 178 | cancel_result thread_cancel( lua_State* L, Lane* s, CancelOp op_, double secs_, bool force_, double waitkill_timeout_) |
179 | { | 179 | { |
180 | // remember that lanes are not transferable: only one thread can cancel a lane, so no multithreading issue here | 180 | // remember that lanes are not transferable: only one thread can cancel a lane, so no multithreading issue here |
181 | // We can read 's->status' without locks, but not wait for it (if Posix no PTHREAD_TIMEDJOIN) | 181 | // We can read 's->status' without locks, but not wait for it (if Posix no PTHREAD_TIMEDJOIN) |
@@ -276,7 +276,7 @@ LUAG_FUNC( thread_cancel) | |||
276 | } | 276 | } |
277 | 277 | ||
278 | { | 278 | { |
279 | bool_t force = lua_toboolean( L, 2); // FALSE if nothing there | 279 | bool const force = lua_toboolean( L, 2) ? true : false; // false if nothing there |
280 | double forcekill_timeout = luaL_optnumber( L, 3, 0.0); | 280 | double forcekill_timeout = luaL_optnumber( L, 3, 0.0); |
281 | 281 | ||
282 | switch( thread_cancel( L, s, op, secs, force, forcekill_timeout)) | 282 | switch( thread_cancel( L, s, op, secs, force, forcekill_timeout)) |