System.InvalidOperationException: Collection was modified

前端 未结 6 1259
花落未央
花落未央 2020-11-30 15:05

I am getting a following exception while enumerating through a queue:

System.InvalidOperationException: Collection was modified; enumeration opera

6条回答
  •  青春惊慌失措
    2020-11-30 15:55

    I think you must have some other thread modifying the tpotActionQueue while you're iterating over it. Since you're only locking that queue inside the for loop this is possible.

提交回复
热议问题