Wait for process to finish running.