summaryrefslogtreecommitdiffstats
path: root/src/Globals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Globals.cpp')
-rw-r--r--src/Globals.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Globals.cpp b/src/Globals.cpp
index b983e3c..5f32482 100644
--- a/src/Globals.cpp
+++ b/src/Globals.cpp
@@ -40,5 +40,19 @@ _AstraExport bool cudaAvailable() {
#endif
}
+
+static bool (*pShouldAbortHook)(void) = 0;
+
+void setShouldAbortHook(bool (*_pShouldAbortHook)(void)) {
+ pShouldAbortHook = _pShouldAbortHook;
+}
+
+bool shouldAbort() {
+ if (pShouldAbortHook && (*pShouldAbortHook)())
+ return true;
+
+ return false;
+}
+
}