From: Chia-I Wu Date: Thu, 24 Jun 2010 08:49:40 +0000 (+0800) Subject: egl: Do not call drv->Initialize with global mutex locked. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=afcea9b115cdfa0a6c948784f753d38b43240d25;p=mesa.git egl: Do not call drv->Initialize with global mutex locked. --- diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 71d2ba06d50..f3a69409c77 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -460,6 +460,7 @@ _EGLDriver * _eglLoadDefaultDriver(EGLDisplay dpy, EGLint *major, EGLint *minor) { _EGLDriver *drv = NULL; + EGLBoolean ok; int i; _eglLockMutex(_eglGlobal.Mutex); @@ -470,10 +471,15 @@ _eglLoadDefaultDriver(EGLDisplay dpy, EGLint *major, EGLint *minor) if (_eglGlobal.NumDrivers == 0) continue; drv = _eglGlobal.Drivers[0]; - if (drv->API.Initialize(drv, dpy, major, minor)) - break; + + _eglUnlockMutex(_eglGlobal.Mutex); + ok = drv->API.Initialize(drv, dpy, major, minor); + _eglLockMutex(_eglGlobal.Mutex); + if (ok) + break; + _eglUnloadDrivers(); - } + } _eglUnlockMutex(_eglGlobal.Mutex);