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

Unified Diff: bench/MutexBench.cpp

Issue 1345853004: move mutex construction out of the benchmarks. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: control yourself klein Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/MutexBench.cpp
diff --git a/bench/MutexBench.cpp b/bench/MutexBench.cpp
index 6dd4e5346f7dbf11a826431dc41ec3187b2b5448..ba92a43033871c045dd39a3c9e33b7adc6d3cf1b 100644
--- a/bench/MutexBench.cpp
+++ b/bench/MutexBench.cpp
@@ -24,16 +24,16 @@ protected:
}
void onDraw(const int loops, SkCanvas*) override {
- Mutex mu;
for (int i = 0; i < loops; i++) {
- mu.acquire();
- mu.release();
+ fMu.acquire();
+ fMu.release();
}
}
private:
typedef Benchmark INHERITED;
SkString fBenchName;
+ Mutex fMu;
};
class SharedBench : public Benchmark {
@@ -48,15 +48,15 @@ protected:
}
void onDraw(const int loops, SkCanvas*) override {
- SkSharedMutex mu;
for (int i = 0; i < loops; i++) {
- mu.acquireShared();
- mu.releaseShared();
+ fMu.acquireShared();
+ fMu.releaseShared();
}
}
private:
typedef Benchmark INHERITED;
+ SkSharedMutex fMu;
};
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698