I am getting a following exception while enumerating through a queue:
System.InvalidOperationException: Collection was modified; enumeration opera
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.