summaryrefslogtreecommitdiffstats
path: root/include/jau
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-05-09 01:12:41 +0200
committerSven Gothel <[email protected]>2022-05-09 01:12:41 +0200
commit2e2b863b6f354b649f8dac181fa44ffe79b80afa (patch)
treed0ff052807edad39109ef2d0ae0dbba458e5c8a9 /include/jau
parent3d02e7d02fd45322000b37f3a94c7988b13a042c (diff)
root_environment: Add static atomic state 'is_terminating()', set by atexit() callback or manual (i.e. for JVM shutdown)
Diffstat (limited to 'include/jau')
-rw-r--r--include/jau/environment.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/jau/environment.hpp b/include/jau/environment.hpp
index 261f103..d0732fd 100644
--- a/include/jau/environment.hpp
+++ b/include/jau/environment.hpp
@@ -49,6 +49,16 @@ namespace jau {
* </p>
*/
class root_environment {
+ public:
+ /**
+ * Optional path to signal early termination, i.e. JVM shutdown.
+ */
+ static void set_terminating() noexcept;
+ /**
+ * Returns true if program is terminating as detected via atexit() callback
+ * or set_terminating() has been called.
+ */
+ static bool is_terminating() noexcept;
};
/**