diff options
| author | Alyssa Milburn | 2014-02-15 17:54:26 +0100 | 
|---|---|---|
| committer | Alyssa Milburn | 2014-02-15 17:54:26 +0100 | 
| commit | 0a00f2c91ab43e7d195856c8463e6b5e4d75486a (patch) | |
| tree | 9b111d6017f0a4c89b7453eec968d9c4b01d51e6 /backends/platform/android/org | |
| parent | f8cea0ebea44c675edc2e45243649f121f362da0 (diff) | |
| parent | 2d903d966875bb2bc665cd33d3514fb6b2dcf7f5 (diff) | |
| download | scummvm-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/android/org')
| -rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVM.java | 8 | 
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 | 
