Move to newer clang annotations

Also enable -Wthread-safety-negative.

Changes:
Switch to capabilities and negative capabilities.

Future work:
Use capabilities to implement uninterruptible annotations to work
with AssertNoThreadSuspension.

Bug: 20072211

Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index 36e3aa3..9d41018 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -87,7 +87,7 @@
    * If the call has not yet finished in another thread, wait for it.
    */
   bool CheckOnLoadResult()
-      LOCKS_EXCLUDED(jni_on_load_lock_) {
+      REQUIRES(!jni_on_load_lock_) {
     Thread* self = Thread::Current();
     bool okay;
     {
@@ -112,7 +112,7 @@
     return okay;
   }
 
-  void SetResult(bool result) LOCKS_EXCLUDED(jni_on_load_lock_) {
+  void SetResult(bool result) REQUIRES(!jni_on_load_lock_) {
     Thread* self = Thread::Current();
     MutexLock mu(self, jni_on_load_lock_);
 
@@ -210,8 +210,8 @@
 
   // See section 11.3 "Linking Native Methods" of the JNI spec.
   void* FindNativeMethod(ArtMethod* m, std::string& detail)
-      EXCLUSIVE_LOCKS_REQUIRED(Locks::jni_libraries_lock_)
-      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+      REQUIRES(Locks::jni_libraries_lock_)
+      SHARED_REQUIRES(Locks::mutator_lock_) {
     std::string jni_short_name(JniShortName(m));
     std::string jni_long_name(JniLongName(m));
     const mirror::ClassLoader* declaring_class_loader = m->GetDeclaringClass()->GetClassLoader();