private void cleanUp() { synchronized (tasks) { for (AsyncTask task : tasks) { if (task.isReadyToClose()) { task.close(); } } } }