当我在代码中的 lock (...) 或 ONLY IF 语句之后创建断点时,在 monodroid 中调试多线程应用程序时 - 它不起作用。但是当我在该关键字之前设置断点然后逐步调试时它会起作用。为什么?如何解决?
代码(传感器监听类):
static object lockAll = new object();
public void OnSensorChanged(SensorEvent ev)
{
int g1 = 8; //Breakpoint in this place works
lock (lockAll)
{
int g2 = 8; //Breakpoint in this place isn't works
}
}
或者:
public void OnSensorChanged(SensorEvent ev)
{
Sensor curS = ev.Sensor; //Breakpoint in this place works
if (curS.Type == SensorType.Accelerometer)
{
int g2 = 8; //Breakpoint in this place isn't works
}
}