In Debug, SkMutex(pthread) crashes on re-entrant aquire from same thread.
authorhalcanary <halcanary@google.com>
Fri, 20 Jun 2014 16:05:56 +0000 (09:05 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 20 Jun 2014 16:05:56 +0000 (09:05 -0700)
R=mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/338973006

src/ports/SkMutex_pthread.h

index 1904140c4cc651f2c7b5bf3191a7c97e81f8591d..662e549f12e65dd29cc6cd2b632327e8a026afea 100644 (file)
@@ -19,6 +19,7 @@
 // a corresponding static finalizer).
 struct SkBaseMutex {
     void acquire() {
+        SkASSERT(fOwner != pthread_self());  // SkMutex is not re-entrant
         pthread_mutex_lock(&fMutex);
         SkDEBUGCODE(fOwner = pthread_self();)
     }