move mutex construction out of the benchmarks.

BUG=skia:

Review URL: https://codereview.chromium.org/1345853004
This commit is contained in:
mtklein 2015-09-22 10:38:48 -07:00 committed by Commit bot
parent 78041fab41
commit a16e8bcef1

View File

@ -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;
};
///////////////////////////////////////////////////////////////////////////////