Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Followup to a bug fix.

Addtion of synchronized to the methods triggers an API change.
Per council advice, pushing synch block into the function body.

Change-Id: Iaa395d9720bce499259ab750fe97149715e9f271
  • Loading branch information...
commit 38da5086a65e8065e85bbca3638da752dba1dbe7 1 parent 3aa684e
Alex Sakhartchouk authored
Showing with 16 additions and 10 deletions.
  1. +16 −10 graphics/java/android/renderscript/RSSurfaceView.java
View
26 graphics/java/android/renderscript/RSSurfaceView.java
@@ -77,10 +77,12 @@ public void surfaceCreated(SurfaceHolder holder) {
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public synchronized void surfaceDestroyed(SurfaceHolder holder) {
- // Surface will be destroyed when we return
- if (mRS != null) {
- mRS.setSurface(null, 0, 0);
+ public void surfaceDestroyed(SurfaceHolder holder) {
+ synchronized (this) {
+ // Surface will be destroyed when we return
+ if (mRS != null) {
+ mRS.setSurface(null, 0, 0);
+ }
}
}
@@ -88,9 +90,11 @@ public synchronized void surfaceDestroyed(SurfaceHolder holder) {
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public synchronized void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
- if (mRS != null) {
- mRS.setSurface(holder, w, h);
+ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+ synchronized (this) {
+ if (mRS != null) {
+ mRS.setSurface(holder, w, h);
+ }
}
}
@@ -125,9 +129,11 @@ public RenderScriptGL createRenderScriptGL(RenderScriptGL.SurfaceConfig sc) {
return rs;
}
- public synchronized void destroyRenderScriptGL() {
- mRS.destroy();
- mRS = null;
+ public void destroyRenderScriptGL() {
+ synchronized (this) {
+ mRS.destroy();
+ mRS = null;
+ }
}
public void setRenderScriptGL(RenderScriptGL rs) {
Please sign in to comment.
Something went wrong with that request. Please try again.