intel / external-mesa

16 stars 57 forks source link

Internal: fix race condition when freeing TSD #75

Closed downor closed 6 years ago

downor commented 6 years ago

There is a race condition (_egl_TSDMutex) introduced by recently merged patch,

commit 36e638f3e4c70ed2a99a761be040f957d5d8028c Author: Sun, Yi J yi.j.sun@intel.com Date: Tue Jan 23 13:54:22 2018 +0800

Internal: fix memory leak in mesa.

This happens when it goes into _eglInitTSD then tries to acquire _egl_TSDMutex, which is locked within the same thread because '_egl_TSDInitialized' is set to EGL_FALSE already. (_eglGetCurrentThread->_eglCheckedGetTSD->_eglInitTSD)

To avoid this, it is needed to postpone resetting of '_egl_TSDInitialized' until it is finished to back up the current context.

Signed-off-by: Dongwon Kim dongwon.kim@intel.com

downor commented 6 years ago

Dropping this as the branch is rebased