Index: tools/skpdiff/SkDiffContext.h |
diff --git a/tools/skpdiff/SkDiffContext.h b/tools/skpdiff/SkDiffContext.h |
index 20193b38514248e77ba6e7a34752cf299a413d14..e87f02f093d372fc9cd3f11663fa01f21ef6cce0 100644 |
--- a/tools/skpdiff/SkDiffContext.h |
+++ b/tools/skpdiff/SkDiffContext.h |
@@ -8,9 +8,11 @@ |
#ifndef SkDiffContext_DEFINED |
#define SkDiffContext_DEFINED |
+#include "SkThread.h" |
#include "SkString.h" |
#include "SkTArray.h" |
#include "SkTDArray.h" |
+#include "SkTLList.h" |
class SkWStream; |
class SkImageDiffer; |
@@ -110,13 +112,21 @@ private: |
SkString fBaselinePath; |
SkString fTestPath; |
SkTArray<DiffData> fDiffs; |
- DiffRecord* fNext; |
}; |
+ // This is needed to work around a bug in the multithreaded case where the |
+ // image decoders are crashing when large numbers of threads are invoking |
+ // the decoder at the same time. |
+ SkMutex fImageMutex; |
scroggo
2013/11/05 21:08:52
Could you create a bug add a link to it here?
|
+ |
+ // Used to protect access to fRecords and ensure only one thread is |
+ // adding new entries and/or iterating over the existing entries at a time |
+ SkMutex fRecordMutex; |
+ |
// We use linked list for the records so that their pointers remain stable. A resizable array |
// might change its pointers, which would make it harder for async diffs to record their |
// results. |
- DiffRecord * fRecords; |
+ SkTLList<DiffRecord> fRecords; |
SkImageDiffer** fDiffers; |
int fDifferCount; |