static Var startDeadlockDetector_timer = new Var; static int startDeadlockDetector_interval; static void startDeadlockDetector() { synchronized(startDeadlockDetector_timer) { if (startDeadlockDetector_timer! == null) startDeadlockDetector_timer.set(doEvery_daemon(1000, func { if (empty(printDeadlocks())) null; print("Stopping deadlock detector."); false; })); } }