From a75f32c14688adf442c031d880f8e265c4e0c08b Mon Sep 17 00:00:00 2001 From: Guylaine Prat <guylaine.prat@c-s.fr> Date: Mon, 11 Feb 2019 16:07:00 +0100 Subject: [PATCH] Add the possibility to suspend and resume the dump. Fixes #377 --- .../org/orekit/rugged/errors/DumpManager.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/orekit/rugged/errors/DumpManager.java b/src/main/java/org/orekit/rugged/errors/DumpManager.java index 23f4a4d7..8fd75010 100644 --- a/src/main/java/org/orekit/rugged/errors/DumpManager.java +++ b/src/main/java/org/orekit/rugged/errors/DumpManager.java @@ -48,6 +48,9 @@ public class DumpManager { /** Dump file (default initial value is null, i.e. nothing is dumped). */ private static final ThreadLocal<Dump> DUMP = new ThreadLocal<Dump>(); + /** Boolean to check if the dump is suspended. */ + private static boolean isSuspended = false; + /** Private constructor for utility class. */ private DumpManager() { @@ -81,11 +84,23 @@ public class DumpManager { } } + /** Suspend the dump. + */ + public static void suspend() { + isSuspended = true; + } + + /** Resume the dump. + */ + public static void resume() { + isSuspended = false; + } + /** Check if dump is active for this thread. * @return true if dump is active for this thread */ public static boolean isActive() { - return DUMP.get() != null; + return DUMP.get() != null && !isSuspended; } /** Dump DEM cell data. -- GitLab