Merge "Only allow one thread to abort at a time." into dalvik-dev
diff --git a/src/mutex.cc b/src/mutex.cc
index a2d9558..4760b2f 100644
--- a/src/mutex.cc
+++ b/src/mutex.cc
@@ -47,6 +47,7 @@
 
 void Mutex::Lock() {
   CHECK_MUTEX_CALL(pthread_mutex_lock, (&mutex_));
+  AssertHeld();
 }
 
 bool Mutex::TryLock() {
@@ -58,10 +59,12 @@
     errno = result;
     PLOG(FATAL) << "pthread_mutex_trylock failed for " << name_;
   }
+  AssertHeld();
   return true;
 }
 
 void Mutex::Unlock() {
+  AssertHeld();
   CHECK_MUTEX_CALL(pthread_mutex_unlock, (&mutex_));
 }