Move idle_loop() under Thread