OSDN Git Service

More thread safety in ES2 & EGL APIs
authorChris Forbes <chrisforbes@google.com>
Wed, 12 Sep 2018 00:31:52 +0000 (17:31 -0700)
committerChris Forbes <chrisforbes@google.com>
Tue, 25 Sep 2018 17:46:28 +0000 (17:46 +0000)
commit1aae88c1e046c22152a867704e369f3a680e492c
treeb6dc8530404f1fd79dc428dd2b1d156c94dee8dd
parent9a20cc9744b3569e17c1ed5660ac1392784ccd2e
More thread safety in ES2 & EGL APIs

Tweak ContextPtr to handle move construction/assignment correctly.
This was overlooked when I made the last minute change to use explicit lock/unlock.

Tweak LockGuard to allow construction from ptr to MutexLock, and behave
correctly if mutex == nullptr. This is required because the locking
machinery for EGL is /outside/ the error generation for bad EGLDisplay.

Add 'Big EGL Lock' around most of the EGL API

Bug: b/112184433
Change-Id: Ic4cd5fa9e6a16ae81cbb2b46e1cb881a850749c5
Reviewed-on: https://swiftshader-review.googlesource.com/20628
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
src/Common/MutexLock.hpp
src/OpenGL/libEGL/Display.cpp
src/OpenGL/libEGL/Display.h
src/OpenGL/libEGL/main.cpp
src/OpenGL/libGLESv2/Context.h