diff options
author | Ian Rogers <irogers@google.com> | 2014-12-04 19:53:52 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-12-04 20:04:45 -0800 |
commit | 015b137efb434528173779bc3ec8d72494456254 (patch) | |
tree | 2ccaba9d7465bd9995082a7251d34cf76b1ab1ea /runtime/runtime.h | |
parent | a21fdd0432aa38b63d144ee4b92b6a567aab61d2 (diff) | |
download | android_art-015b137efb434528173779bc3ec8d72494456254.tar.gz android_art-015b137efb434528173779bc3ec8d72494456254.tar.bz2 android_art-015b137efb434528173779bc3ec8d72494456254.zip |
Tidy gAborting.
Reduce scope to Runtime::Abort and short-cut recursive case earlier. gAborting
remains global to avoid two fatal errors in thread and the verifier.
Change-Id: Ibc893f891ffee9a763c65cde9507d99083d47b3f
Diffstat (limited to 'runtime/runtime.h')
-rw-r--r-- | runtime/runtime.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/runtime.h b/runtime/runtime.h index 39fd910893..e334764daa 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -71,6 +71,11 @@ class ThreadList; class Trace; class Transaction; +// 0 if not abort, non-zero if an abort is in progress. Used on fatal exit to prevents recursive +// aborts. Global declaration allows us to disable some error checking to ensure fatal shutdown +// makes forward progress. +extern volatile unsigned int gAborting; + typedef std::vector<std::pair<std::string, const void*>> RuntimeOptions; // Not all combinations of flags are valid. You may not visit all roots as well as the new roots @@ -175,9 +180,9 @@ class Runtime { return instance_; } - // Aborts semi-cleanly. Used in the implementation of LOG(FATAL), which most - // callers should prefer. - [[noreturn]] static void Abort() LOCKS_EXCLUDED(Locks::abort_lock_); + // Aborts semi-cleanly. Used in the implementation of LOG(FATAL), which most callers should + // prefer. Not [[noreturn]] due to returning early in the case of recursive aborts. + static void Abort() LOCKS_EXCLUDED(Locks::abort_lock_); // Returns the "main" ThreadGroup, used when attaching user threads. jobject GetMainThreadGroup() const; |