G
Guest
Hi
I've got a CollectData() method which is called by Timer periodically.
CollectData calls Add(input) - the problem is the code after Add(input) in
CollectData() is never executed. It's as if the monitor is never closed.
CollectData() never executes further then Add(input), except I remove the
monitors. It's an Windows CE 5.0 application.
What is my problem? Hope someone can help.
Thanks!
....
protected void CollectData(object oState)
{
Add(input);
.... // code after Add(input)
Do(input); //if some condition met then Do()
...
}
....
public void Add(string input)
{
try
{
Monitor.Enter(strAdded);
this.strAdded += input;
}
catch (Exception oException)
{
throw oException;
}
finally
{
Monitor.Exit(strAdded);
}
}
....
I've got a CollectData() method which is called by Timer periodically.
CollectData calls Add(input) - the problem is the code after Add(input) in
CollectData() is never executed. It's as if the monitor is never closed.
CollectData() never executes further then Add(input), except I remove the
monitors. It's an Windows CE 5.0 application.
What is my problem? Hope someone can help.
Thanks!
....
protected void CollectData(object oState)
{
Add(input);
.... // code after Add(input)
Do(input); //if some condition met then Do()
...
}
....
public void Add(string input)
{
try
{
Monitor.Enter(strAdded);
this.strAdded += input;
}
catch (Exception oException)
{
throw oException;
}
finally
{
Monitor.Exit(strAdded);
}
}
....