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

Skip to content
Commit e28dd790 authored by Yu-Han Yang's avatar Yu-Han Yang
Browse files

Fix a deadlock in emulator HAL implementation

Before this change, a start() call will wait for previous threads to
finish. However, in ListenerMultiplexer.java in the framework, start(),
stop(), and deliverListener() calls are contending for the same lock.
Therefore, if a waiting start() is holding the lock, while the
almost-finishing thread is also going to hold that lock for calling
deliverListener(), a deadlock will happen.

This CL moves the waiting logic into the new thread of the start() call,
so that start() will return immediately. The new thread will wait for
the old thread to finish, and then start the actual work.

Bug: 299563185
Test: atest CtsLocationGnssTestCases
Change-Id: Ic2993a6d82c24688fa98d26d336c85518c683cf6
parent b1b06175
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