lists, iterate and coroutines

Quick question: if I pass a list to a method that iterates over a list as a parameter, but change the list while the iteration is running, will an error be thrown?


  IEnumerator DoSomething(){
                              yield return new WaitForSeconds(2); 

   DoSomethingElse(List<type> list){
                foreach(Type t in list){

Do I even need to pass the list? The idea behind this is to be able to change the list at anytime while the coroutine is running.

you’re not dealing with multithreading here, nothing will access the list in parallel. coroutines are not threaded.