ロック (...) またはコード内の IF ステートメントのみの後にブレークポイントを作成すると、モノドロイドでマルチスレッド アプリケーションをデバッグするときに動作しません。しかし、そのキーワードの前にブレークポイントを作成してから、段階的なデバッグを行うと機能します。なんで?それをどのように修正しますか?
コード (センサー リスナー クラス):
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
}
}