Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: dm/DM.cpp

Issue 2055023003: Type-erase SkAutoMutexAcquire and SkAutoExclusive. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/private/SkMutex.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 9ddff282f386f6b2ec300454c8e1eb8829da682c..158d256fad89ff62d150160b9b6e9c07200bcf2b 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -128,7 +128,7 @@ static void done(const char* config, const char* src, const char* srcOptions, co
vlog("done %s\n", id.c_str());
int pending;
{
- SkAutoTAcquire<SkSpinlock> lock(gMutex);
+ SkAutoMutexAcquire lock(gMutex);
for (int i = 0; i < gRunning.count(); i++) {
if (gRunning[i] == id) {
gRunning.removeShuffle(i);
@@ -147,7 +147,7 @@ static void done(const char* config, const char* src, const char* srcOptions, co
static void start(const char* config, const char* src, const char* srcOptions, const char* name) {
SkString id = SkStringPrintf("%s %s %s %s", config, src, srcOptions, name);
vlog("start %s\n", id.c_str());
- SkAutoTAcquire<SkSpinlock> lock(gMutex);
+ SkAutoMutexAcquire lock(gMutex);
gRunning.push_back(id);
}
@@ -156,7 +156,7 @@ static void print_status() {
peak = sk_tools::getMaxResidentSetSizeMB();
SkString elapsed = HumanizeMs(SkTime::GetMSecs() - kStartMs);
- SkAutoTAcquire<SkSpinlock> lock(gMutex);
+ SkAutoMutexAcquire lock(gMutex);
info("\n%s elapsed, %d active, %d queued, %dMB RAM, %dMB peak\n",
elapsed.c_str(), gRunning.count(), gPending - gRunning.count(), curr, peak);
for (auto& task : gRunning) {
@@ -179,7 +179,7 @@ static void print_status() {
#undef _
};
- SkAutoTAcquire<SkSpinlock> lock(gMutex);
+ SkAutoMutexAcquire lock(gMutex);
const DWORD code = e->ExceptionRecord->ExceptionCode;
info("\nCaught exception %u", code);
@@ -205,7 +205,7 @@ static void print_status() {
#include <stdlib.h>
static void crash_handler(int sig) {
- SkAutoTAcquire<SkSpinlock> lock(gMutex);
+ SkAutoMutexAcquire lock(gMutex);
info("\nCaught signal %d [%s], was running:\n", sig, strsignal(sig));
for (auto& task : gRunning) {
@@ -1300,7 +1300,7 @@ int dm_main() {
if (src->veto(sink->flags()) ||
is_blacklisted(sink.tag.c_str(), src.tag.c_str(),
src.options.c_str(), src->name().c_str())) {
- SkAutoTAcquire<SkSpinlock> lock(gMutex);
+ SkAutoMutexAcquire lock(gMutex);
gPending--;
continue;
}
« no previous file with comments | « no previous file | include/private/SkMutex.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698