Make tsan happy.

tsan was unhappy with our static Mutex, claiming a race between the constructor
writing the 'rank_' field and Mutex::Lock reading it. My understanding of the
GCC static initialization acquire/release code is that it includes memory
barriers that should make this safe, so I'm reaching out to the tsan guys. In
the meantime, let's just make this MethodVerifier lock & collection like the
other MethodVerifier locks & collections.

  WARNING: Possible data race during read of size 4 at 0x1A42F09C: {{{
   T2 (Compiler Worker) (L{}):
    #0  art::Mutex::Lock /home/enh/local-disk/clean-dalvik-dev/art/src/mutex.cc:89
    #1  art::verifier::MethodVerifier::IsClassRejected /usr/local/google/home/enh/clean-dalvik-dev/art/src/mutex.h:77
    #2  art::Compiler::CompileClass /home/enh/local-disk/clean-dalvik-dev/art/src/compiler.cc:1420
    #3  art::WorkerThread::Go /home/enh/local-disk/clean-dalvik-dev/art/src/compiler.cc:1013
  Concurrent write(s) happened at (OR AFTER) these points:
   T1 (Compiler Worker) (L{}):
    #0  art::Mutex::Mutex /home/enh/local-disk/clean-dalvik-dev/art/src/mutex.cc:67
    #1  art::verifier::MethodVerifier::IsClassRejected /home/enh/local-disk/clean-dalvik-dev/art/src/verifier/method_verifier.cc:3334
    #2  art::Compiler::CompileClass /home/enh/local-disk/clean-dalvik-dev/art/src/compiler.cc:1420
    #3  art::WorkerThread::Go /home/enh/local-disk/clean-dalvik-dev/art/src/compiler.cc:1013
  Address 0x1A42F09C is 28 bytes inside data symbol "_ZZN3art8verifierL22GetRejectedClassesLockEvE21rejected_classes_lock"
   Race verifier data: 0x1A198B1E,0x1A198025
  }}}

(cherry picked from commit 6356df46fb0ebff5467d3103b97c3c871940e402)

Change-Id: I26a9c91f133370161ab4679e36d9a02315d28847
4 files changed
tree: 4f4f72efe2d3fa076faf39c2ce084c9de9f5a4fe
  1. build/
  2. jdwpspy/
  3. src/
  4. test/
  5. tools/
  6. .gitignore
  7. Android.mk