diff options
author | 2023-09-10 02:54:14 +0000 | |
---|---|---|
committer | 2023-12-19 07:55:10 +0000 | |
commit | c6371b52df0da31acc174a3526274417b7aac0a7 (patch) | |
tree | 4cfa7d692f308c733c2952f73878a4061962da48 /compiler/optimizing/side_effects_analysis.cc | |
parent | 5e38ea5e680490f40c76faa348d8b979882b3261 (diff) |
Revert^16 "Thread suspension cleanup and deadlock fix"
This reverts commit a43e67ea1a314e5c6faf77457ffc5ea39c24d4ca.
PS1 is identical to aosp/2725875 .
PS2 improves static and dynamic lock checking and makes the
documentation more precise. ThreadList::Unregister for a thread
that wasn't registered becomes fatal; I can't convince myself that
any reasonable recovery is possible, and we could otherwise turn an
obvious error into a very subtle and potentially dangerous one.
Perhaps controversially, we now REQUIRE thread_list_lock_ for
IncrementSuspendCount, eventhough that requires a kludge in the one
case in which we legitimately don't have it. But after thinking about
it, the extra checking and documentation outweighs the kludge, and we
may want to consider this elsewhere as well. Added FakeMutexLock
to enable the kludge here and elsewhere.
PS3 adds some documentation for thread lifetime rules and enforces
a sufficient, though in some cases overly strong, set of related
restrictions for EnsureFlipFunctionStarted. It ensures that callers
conform to this stronger restriction. This required a simplification
in StackUtil::GetThreadListStackTraces.
PS4 Fix lint issue. Add Thread lifetime DCHECK to WaitForFlipFunction.
Rebase to adjust for the fact that aosp/2813551 effectively merged
a small piece of this.
PS5 Add Thread::VerifyState(). We previouslly checked for kTerminated
in a couple of places. That doesn't make sense, since we have no
way to tell whether the thread has been deallocated and reallocated at
that point. Instead of checking that the state is not kTerminated,
just check that it is a sane value. Address some old reviewer
comments. Add more output for EnsureFlipFunctionStarted DCHECK.
RequestSynchronousCheckpoint now aborts rather than returning false
when invoked on a terminated thread. Seeing kTerminated would mean
the thread could have been destroyed, and thus this call was unsafe.
PS6 Add another VerifyState call to RequestSynchronousCheckpoint.
PS7 Rebase and add more ThreadExitFlag tests.
PS8 Rebase. Temporary workaround for compile error.
PS9 Remove PS8 workaround. Add a version of GetPeerFromOtherThread
that expects thread_list_lock_ to be initially held, and relies on
ThreadExitFlag to detect terminated threads. Modify several jvmti
clients to use this correctly. This effectively includes a fixed
version of aosp/2847246.
PS10 Work around the fact that GetReferenceKind in ti_heap.cc may
call GetPeerFromOtherThread with or without thread_list_lock_.
I think this is kind of benign, though it makes reasoning harder,
and weakens our debug checking.
PS11 Remove extra semicolon.
PS12 Add another DCHECK in UnregisterThreadExitFlag.
PS13 Minor tweaks to address reviewer comments.
PS14 More tweaks to address reviewer comments.
PS15 Do not report that a thread exited while its flip-function is
still running.
PS16 Fix comment typo.
Test: Treehugger
Bug: 240742796
Bug: 203363895
Bug: 238032384
Bug: 253671779
Bug: 276660630
Bug: 295880862
Bug: 294334417
Bug: 301090887
Bug: 313347640
(and more)
Change-Id: I44caa30a0a4da8ab105fedd4d2238f59efc1d675
Diffstat (limited to 'compiler/optimizing/side_effects_analysis.cc')
0 files changed, 0 insertions, 0 deletions