please include function _registerThread. static Thread _unregisterThread(Thread t) { _registerThread_threads.remove(t); ret t; } static void _unregisterThread() { _unregisterThread(currentThread()); }