I have such code:
public void RangeMissing(/*params*/)
{
Task.Factory.StartNew(() =>
{
....
bool needReceive = true;
while (needReceive) {
....
lock (lockObj) {
....
// calling third party dll method that calls MdrResponseInterpreter in its turn
}
}
}
}
public bool MdrResponseInterpreter(DNMessageDeliverer builder, DNFieldSet message)
{
.....
// i need to update needReceive here
needReceive = false;
}
Several task may be executing at the same time. I need to update needReceive
variable of corresponding Task
from MdrResponseInterpreter