Do synchronized setOnline logic in events thread