summaryrefslogtreecommitdiff
path: root/runtime/base/mutex.h
diff options
context:
space:
mode:
author David Sehr <sehr@google.com> 2016-10-21 15:30:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-10-21 15:30:22 +0000
commit77cd3d861fcf723ba0a37833c223eeb08cfd7d8c (patch)
treee4cd7833fe8fec4e4b216e156312a323f23e8f02 /runtime/base/mutex.h
parent6c42676b466c4f08cfa6ca43da65bc74f48dc063 (diff)
parentf42eb2c7801dbb45a6ba20a372d5ba4712ebefba (diff)
Merge "Remove mutex dependency on art::Runtime"
Diffstat (limited to 'runtime/base/mutex.h')
-rw-r--r--runtime/base/mutex.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h
index e0cca7b0ce..3f2c5a9e74 100644
--- a/runtime/base/mutex.h
+++ b/runtime/base/mutex.h
@@ -558,6 +558,18 @@ class Locks {
public:
static void Init();
static void InitConditions() NO_THREAD_SAFETY_ANALYSIS; // Condition variables.
+
+ // Destroying various lock types can emit errors that vary depending upon
+ // whether the client (art::Runtime) is currently active. Allow the client
+ // to set a callback that is used to check when it is acceptable to call
+ // Abort. The default behavior is that the client *is not* able to call
+ // Abort if no callback is established.
+ using ClientCallback = bool();
+ static void SetClientCallback(ClientCallback* is_safe_to_call_abort_cb) NO_THREAD_SAFETY_ANALYSIS;
+ // Checks for whether it is safe to call Abort() without using locks.
+ static bool IsSafeToCallAbortRacy() NO_THREAD_SAFETY_ANALYSIS;
+
+
// Guards allocation entrypoint instrumenting.
static Mutex* instrument_entrypoints_lock_;