d'oh: use member, not local variable to synchronize

This commit is contained in:
Ahmet Inan 2015-01-22 12:29:28 +01:00
parent 77e2c06d96
commit 88f22d7ca8
3 changed files with 9 additions and 10 deletions

View file

@ -46,7 +46,7 @@ public class ImageView extends SurfaceView implements SurfaceHolder.Callback {
}
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
synchronized (holder) {
synchronized (this.holder) {
canvasWidth = width;
canvasHeight = height;
}
@ -54,13 +54,13 @@ public class ImageView extends SurfaceView implements SurfaceHolder.Callback {
}
public void surfaceCreated(SurfaceHolder holder) {
synchronized (holder) {
synchronized (this.holder) {
cantTouchThis = false;
}
}
public void surfaceDestroyed(SurfaceHolder holder) {
synchronized (holder) {
synchronized (this.holder) {
cantTouchThis = true;
}
}

View file

@ -41,7 +41,7 @@ public class SpectrumView extends SurfaceView implements SurfaceHolder.Callback
}
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
synchronized (holder) {
synchronized (this.holder) {
canvasWidth = width;
canvasHeight = height;
}
@ -49,13 +49,13 @@ public class SpectrumView extends SurfaceView implements SurfaceHolder.Callback
}
public void surfaceCreated(SurfaceHolder holder) {
synchronized (holder) {
synchronized (this.holder) {
cantTouchThis = false;
}
}
public void surfaceDestroyed(SurfaceHolder holder) {
synchronized (holder) {
synchronized (this.holder) {
cantTouchThis = true;
}
}

View file

@ -17,7 +17,6 @@
package xdsopl.robot36;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@ -40,7 +39,7 @@ public class VUMeterView extends SurfaceView implements SurfaceHolder.Callback {
}
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
synchronized (holder) {
synchronized (this.holder) {
canvasWidth = width;
canvasHeight = height;
}
@ -48,13 +47,13 @@ public class VUMeterView extends SurfaceView implements SurfaceHolder.Callback {
}
public void surfaceCreated(SurfaceHolder holder) {
synchronized (holder) {
synchronized (this.holder) {
cantTouchThis = false;
}
}
public void surfaceDestroyed(SurfaceHolder holder) {
synchronized (holder) {
synchronized (this.holder) {
cantTouchThis = true;
}
}