diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-08 16:57:53 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-04-08 17:00:56 +0200 |
commit | 96daea993eeea17f0c64325491943e48795ff751 (patch) | |
tree | 653072dc81d0360382576b520e19619b0e06d085 /src/macros_and_utils.h | |
parent | 63b930ebc5060efecea0ec3acf7e5c93e4047864 (diff) | |
download | lanes-96daea993eeea17f0c64325491943e48795ff751.tar.gz lanes-96daea993eeea17f0c64325491943e48795ff751.tar.bz2 lanes-96daea993eeea17f0c64325491943e48795ff751.zip |
C++ migration: use std::jthread, std::condition_variable, std::chrono.
win32 pthread support is gone
new setting configure.shutdown_mode for cancellation of free-running threads at shutdown.
no more hard thread termination! If a thread doesn't cooperate, an error is raised.
lane.status "killed" is gone
lane:cancel can't force-kill.
Diffstat (limited to 'src/macros_and_utils.h')
-rw-r--r-- | src/macros_and_utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/macros_and_utils.h b/src/macros_and_utils.h index e29e7fb..997b452 100644 --- a/src/macros_and_utils.h +++ b/src/macros_and_utils.h | |||
@@ -11,9 +11,12 @@ extern "C" { | |||
11 | #endif // __cplusplus | 11 | #endif // __cplusplus |
12 | 12 | ||
13 | #include <cassert> | 13 | #include <cassert> |
14 | #include <chrono> | ||
14 | #include <tuple> | 15 | #include <tuple> |
15 | #include <type_traits> | 16 | #include <type_traits> |
16 | 17 | ||
18 | using namespace std::chrono_literals; | ||
19 | |||
17 | #define USE_DEBUG_SPEW() 0 | 20 | #define USE_DEBUG_SPEW() 0 |
18 | #if USE_DEBUG_SPEW() | 21 | #if USE_DEBUG_SPEW() |
19 | extern char const* debugspew_indent; | 22 | extern char const* debugspew_indent; |
@@ -167,3 +170,5 @@ T* lua_newuserdatauv(lua_State* L, int nuvalue_) | |||
167 | std::ignore = lua_error(L); // doesn't return | 170 | std::ignore = lua_error(L); // doesn't return |
168 | assert(false); // we should never get here, but i'm paranoid | 171 | assert(false); // we should never get here, but i'm paranoid |
169 | } | 172 | } |
173 | |||
174 | using lua_Duration = std::chrono::template duration<lua_Number>; | ||