diff options
author | Chia-I Wu <olv@lunarg.com> | 2010-06-24 16:49:40 +0800 |
---|---|---|
committer | Chia-I Wu <olv@lunarg.com> | 2010-06-29 17:16:20 +0800 |
commit | afcea9b115cdfa0a6c948784f753d38b43240d25 (patch) | |
tree | bd102a29f57d06acee33152de8d1cc630677f48c /src/egl | |
parent | a81ef14228c6fe2893527b7b5f12855c90db3f8e (diff) |
egl: Do not call drv->Initialize with global mutex locked.
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/main/egldriver.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 71d2ba06d5..f3a69409c7 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); |