I have two static procedures in one class that are called at various points during real time.
Both procedures access the same list. One adds to the list, the other removes items from the list.
The problem is that they are both conflicting with each other and I repeatedly receive the message:
"Collection was modified; enumeration operation may not execute"
Forgive my ignorance. But I believe I need to lock the collection somehow, whilst one task is working on it. But I also want the other process to immediate take over once the other task has finished.
Thanks in advance