diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-29 12:11:56 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-29 12:11:56 +0100 |
commit | acb203829bfd12b4cc0c90f82cb70a4d111bce46 (patch) | |
tree | a36653f50954a3242866b8d19b7c328130b35238 /src/cancel.cpp | |
parent | 749b9ed927929c3492def9a241a5267394306551 (diff) | |
download | lanes-acb203829bfd12b4cc0c90f82cb70a4d111bce46.tar.gz lanes-acb203829bfd12b4cc0c90f82cb70a4d111bce46.tar.bz2 lanes-acb203829bfd12b4cc0c90f82cb70a4d111bce46.zip |
C++ migration: Lane is a proper class with overloaded operator new/delete
Diffstat (limited to 'src/cancel.cpp')
-rw-r--r-- | src/cancel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp index 0f7a6af..07c316a 100644 --- a/src/cancel.cpp +++ b/src/cancel.cpp | |||
@@ -162,7 +162,7 @@ static CancelResult thread_cancel_hard(lua_State* L, Lane* lane_, double secs_, | |||
162 | (void) waitkill_timeout_; // unused | 162 | (void) waitkill_timeout_; // unused |
163 | (void) L; // unused | 163 | (void) L; // unused |
164 | #endif // THREADAPI == THREADAPI_PTHREAD | 164 | #endif // THREADAPI == THREADAPI_PTHREAD |
165 | lane_->mstatus = ThreadStatus::Killed; // mark 'gc' to wait for it | 165 | lane_->mstatus = Lane::Killed; // mark 'gc' to wait for it |
166 | // note that lane_->status value must remain to whatever it was at the time of the kill | 166 | // note that lane_->status value must remain to whatever it was at the time of the kill |
167 | // because we need to know if we can lua_close() the Lua State or not. | 167 | // because we need to know if we can lua_close() the Lua State or not. |
168 | result = CancelResult::Killed; | 168 | result = CancelResult::Killed; |
@@ -176,7 +176,7 @@ CancelResult thread_cancel(lua_State* L, Lane* lane_, CancelOp op_, double secs_ | |||
176 | { | 176 | { |
177 | // remember that lanes are not transferable: only one thread can cancel a lane, so no multithreading issue here | 177 | // remember that lanes are not transferable: only one thread can cancel a lane, so no multithreading issue here |
178 | // We can read 'lane_->status' without locks, but not wait for it (if Posix no PTHREAD_TIMEDJOIN) | 178 | // We can read 'lane_->status' without locks, but not wait for it (if Posix no PTHREAD_TIMEDJOIN) |
179 | if (lane_->mstatus == ThreadStatus::Killed) | 179 | if (lane_->mstatus == Lane::Killed) |
180 | { | 180 | { |
181 | return CancelResult::Killed; | 181 | return CancelResult::Killed; |
182 | } | 182 | } |