multithreading and inner class