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

Skip to content
Commit 8b2c9c9e authored by Jack Palevich's avatar Jack Palevich
Browse files

Improve GLSurfaceView to avoid deadlocks and race conditions.

This is work towards fixing bug 2228262

Specific issues fixed by this change:

+ GLThread names now include the thread id, making it easier to tell one
GLThread from another.

+ A private final static boolean LOG_THREADS can be set to true at compile
time to print out thread-related trace information, helpful for debugging
GLSurfaceView behavior. This static defaults to "false".

+ Changed calls to "notify" to "notifyAll" to make the code more
robust in case more than two threads are blocked on the same monitor.

+ Add a GLThreadManager to help manage the transition to
a new GLThread. Currently only one GLThread can be active in an address
space. When the second thread starts up, the GLThreadManager helps the old
GLThread to shut down,

+ Make sure we stop waiting for dead GLThreads. This is done by adding
checks for a variable mDone being true to our monitor wait loops. And
we use a "finally" clause at the end of GLThread.run() method to set mDone
and notifyAll any wait loops.
parent bfa68abc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment