static Var startDeadlockDetector_timer = new Var; static int startDeadlockDetector_interval; static bool startDeadlockDetector_noStop; // don't stop when deadlock found static void startDeadlockDetector() { synchronized(startDeadlockDetector_timer) { if (startDeadlockDetector_timer! == null) startDeadlockDetector_timer.set(doEvery_daemon(1000, func { if (empty(printDeadlocks())) null; if (startDeadlockDetector_noStop) { print("Stopping deadlock detector."); false; } null; })); } }