Package org.sosy_lab.java_smt.basicimpl
Class ShutdownHook
- java.lang.Object
-
- org.sosy_lab.java_smt.basicimpl.ShutdownHook
-
- All Implemented Interfaces:
AutoCloseable
,ShutdownNotifier.ShutdownRequestListener
public final class ShutdownHook extends Object implements ShutdownNotifier.ShutdownRequestListener, AutoCloseable
A utility class for interrupting a parallel running solver thread.The hook is active directly after its construction until calling the method
close()
and forwards all shutdown requests to the provided method.
-
-
Constructor Summary
Constructors Constructor Description ShutdownHook(ShutdownNotifier pShutdownNotifier, Runnable pInterruptCall)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
shutdownRequested(@Nullable String reasonUnused)
-
-
-
Constructor Detail
-
ShutdownHook
public ShutdownHook(ShutdownNotifier pShutdownNotifier, Runnable pInterruptCall)
-
-
Method Detail
-
shutdownRequested
public void shutdownRequested(@Nullable String reasonUnused)
- Specified by:
shutdownRequested
in interfaceShutdownNotifier.ShutdownRequestListener
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
-