void onContainerActivation(ActiveContainer nextContainer) {
        synchronized (monitor) {
            if (currentContainer != null) {
                deactivatedContainers.add(new DeactivatedContainer(currentContainer, currentContainerActivationTime, clock.instant()));
            }
            currentContainer = nextContainer;
            currentContainerActivationTime = clock.instant();
            if (threadMonitoringTask != null) threadMonitoringTask.cancel(false);
            if (enableScheduler) threadMonitoringTask = scheduler.schedule(this::monitorThreads, 1, TimeUnit.MINUTES);
        }
    }
A watchdog that monitors all deactivated {@link ActiveContainer} instances with the purpose of detecting stale containers.

@author bjorncs
jdisc_core/src/main/java/com/yahoo/jdisc/core/ContainerWatchdog.java