// This is a debug tool to verify an object is only being used from one thread at a time. class SingleOwner { public:
SingleOwner() : fOwner(kIllegalThreadID), fReentranceCount(0) {}
voidexit(constchar* file, int line) {
SkAutoMutexExclusive lock(fMutex);
SkASSERTF(fOwner == SkGetThreadID(), "%s:%d Single owner failure.", file, line);
fReentranceCount--; if (fReentranceCount == 0) {
fOwner = kIllegalThreadID;
}
}
SkMutex fMutex;
SkThreadID fOwner SK_GUARDED_BY(fMutex); int fReentranceCount SK_GUARDED_BY(fMutex);
}; #else #define SKGPU_ASSERT_SINGLE_OWNER(obj) class SingleOwner {}; // Provide a no-op implementation so we can pass pointers to constructors #endif
} // namespace skgpu
#endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.