Log.i("GLThread", "waiting tid=" + getId()
+ " mHaveEglContext: " + mHaveEglContext
+ " mHaveEglSurface: " + mHaveEglSurface
+ + " mFinishedCreatingEglSurface: " + mFinishedCreatingEglSurface
+ " mPaused: " + mPaused
+ " mHasSurface: " + mHasSurface
+ " mSurfaceIsBad: " + mSurfaceIsBad
if (LOG_SURFACE) {
Log.w("GLThread", "egl createSurface");
}
- if (!mEglHelper.createSurface()) {
+ if (mEglHelper.createSurface()) {
synchronized(sGLThreadManager) {
+ mFinishedCreatingEglSurface = true;
+ sGLThreadManager.notifyAll();
+ }
+ } else {
+ synchronized(sGLThreadManager) {
+ mFinishedCreatingEglSurface = true;
mSurfaceIsBad = true;
sGLThreadManager.notifyAll();
}
Log.i("GLThread", "surfaceCreated tid=" + getId());
}
mHasSurface = true;
+ mFinishedCreatingEglSurface = false;
sGLThreadManager.notifyAll();
- while((mWaitingForSurface) && (!mExited)) {
+ while (mWaitingForSurface
+ && !mFinishedCreatingEglSurface
+ && !mExited) {
try {
sGLThreadManager.wait();
} catch (InterruptedException e) {
private boolean mWaitingForSurface;
private boolean mHaveEglContext;
private boolean mHaveEglSurface;
+ private boolean mFinishedCreatingEglSurface;
private boolean mShouldReleaseEglContext;
private int mWidth;
private int mHeight;