Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 86f9f749 authored by Yiwei Zhang's avatar Yiwei Zhang
Browse files

opengl: fix a race condition when unloading gl driver

Previously, EGL apis call clearError() at the first place including those core
apis which initialize the driver. Calling clearError() before the driver has
been loaded is basically a no-op.

Later the driver unloading mechanism was added to support Angle and updatable
driver with EGL/GL driver still preloaded in Zygote. However, calling
clearError() on another thread races with the driver unloading process. So this
change moves the clearError() calls after the driver has been successfully
unloaded and reloaded, so that the initial core apis will be protected by the
driver loading lock in the loader.

For those non-core apis, they could still be incorrectly called before calling
any of those core apis on another thread when the driver unloading and reloading
is still on going. Since this scenario is supposed to error out anyway, so the
apps need to use EGL apis correctly by themselves.

Bug: 140072978
Test: CtsAngleDeveloperOptionHostTest
Change-Id: Ica5b19edc0dfb0a0910f56c1442eaff63f76b35a
parent ad294ee6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment