aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorAlyssa Milburn2014-02-15 17:54:26 +0100
committerAlyssa Milburn2014-02-15 17:54:26 +0100
commit0a00f2c91ab43e7d195856c8463e6b5e4d75486a (patch)
tree9b111d6017f0a4c89b7453eec968d9c4b01d51e6 /backends/platform
parentf8cea0ebea44c675edc2e45243649f121f362da0 (diff)
parent2d903d966875bb2bc665cd33d3514fb6b2dcf7f5 (diff)
downloadscummvm-rg350-0a00f2c91ab43e7d195856c8463e6b5e4d75486a.tar.gz
scummvm-rg350-0a00f2c91ab43e7d195856c8463e6b5e4d75486a.tar.bz2
scummvm-rg350-0a00f2c91ab43e7d195856c8463e6b5e4d75486a.zip
Merge pull request #432 from klusark/race
ANDROID: Fix a race condition
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVM.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVM.java b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
index 3a25b54eeb..5047502e61 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVM.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
@@ -86,13 +86,15 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
Log.d(LOG_TAG, String.format("surfaceChanged: %dx%d (%d)",
width, height, format));
+ // store values for the native code
+ // make sure to do it before notifying the lock
+ // as it leads to a race condition otherwise
+ setSurface(width, height);
+
synchronized(_sem_surface) {
_surface_holder = holder;
_sem_surface.notifyAll();
}
-
- // store values for the native code
- setSurface(width, height);
}
// SurfaceHolder callback