diff options
| author | 2021-08-05 18:30:08 -0700 | |
|---|---|---|
| committer | 2021-08-07 15:16:49 +0000 | |
| commit | 0c3cc6350749a441fd54f8f3f67b7c69775000c8 (patch) | |
| tree | b1269dfa3f20f2abee25a880df1ad36884ff3f56 /libnativeloader/native_loader_test.cpp | |
| parent | 825e82972fe46fdb0419c42bd7df102df1989ff9 (diff) | |
Handle suspend requests in getReferent()
When waiting in getReferent or the like, use a TimedWait, so we
can occasionally check for suspend requests, thus avoiding deadlocks
that can arise from blocking indefinitely in a runnable state.
This is not particularly clean, and may introduce short delays
when we would otherwise deadlock. It's also a bit risky because
we are now releasing the mutator lock in code that previously didn't.
This is a hopefully more correct replacement for aosp/1784003, which
overlooked some of the complications here.
This does not handle a similar problem in the JNI weak reference code.
Each additional use context adds risk here, due to the mutator
lock release.
Bug: 195336624
Bug: 195664026
Test: Build and boot AOSP with much shorter timeouts.
Test: Confirm that the timeout code is invoked.
Change-Id: I0ffb2ffd105bed9dcb8664f92b17cfbcf756a6e0
Diffstat (limited to 'libnativeloader/native_loader_test.cpp')
0 files changed, 0 insertions, 0 deletions