Pass timer to anonymous class as parameter - thread safety