Index: tools/skpdiff/SkDiffContext.h |
diff --git a/tools/skpdiff/SkDiffContext.h b/tools/skpdiff/SkDiffContext.h |
index 20193b38514248e77ba6e7a34752cf299a413d14..42282d2f670e32cc4b2515d2cb5db13de80dab17 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,22 @@ 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. |
+ // see https://code.google.com/p/skia/issues/detail?id=1803 |
+ SkMutex fImageMutex; |
+ |
+ // 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; |
mtklein
2013/11/06 14:24:36
You don't seem to grab this mutex when iterating o
djsollen
2013/11/06 15:01:58
I just forgot to clean up that comment after updat
|
+ |
// 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; |