aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/nanobench.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-10-30 11:57:15 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-30 16:45:29 +0000
commit03141d25cf75c4ce6cdb94f90e9538ee3c878699 (patch)
treed635693f932ac01306c0bda8b388911a1f79199b /bench/nanobench.cpp
parentcc309eb9b18a707dfb94d89866a474bebf7f2777 (diff)
remove SkThread, using std::thread instead
Change-Id: I871dd5eea4496e87c206b46d9eae81cb521b11ce Reviewed-on: https://skia-review.googlesource.com/65103 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'bench/nanobench.cpp')
-rw-r--r--bench/nanobench.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index c5dfe0cf7f..550e0b7744 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -45,13 +45,13 @@
#include "SkString.h"
#include "SkSurface.h"
#include "SkTaskGroup.h"
-#include "SkThreadUtils.h"
#include "SkTraceEvent.h"
#include "Stats.h"
#include "ThermalManager.h"
#include "ios_utils.h"
#include <stdlib.h>
+#include <thread>
extern bool gSkForceRasterPipelineBlitter;
@@ -1109,21 +1109,18 @@ private:
// Some runs (mostly, Valgrind) are so slow that the bot framework thinks we've hung.
// This prints something every once in a while so that it knows we're still working.
static void start_keepalive() {
- struct Loop {
- static void forever(void*) {
- for (;;) {
- static const int kSec = 1200;
- #if defined(SK_BUILD_FOR_WIN)
- Sleep(kSec * 1000);
- #else
- sleep(kSec);
- #endif
- SkDebugf("\nBenchmarks still running...\n");
- }
+ static std::thread* intentionallyLeaked = new std::thread([]{
+ for (;;) {
+ static const int kSec = 1200;
+ #if defined(SK_BUILD_FOR_WIN)
+ Sleep(kSec * 1000);
+ #else
+ sleep(kSec);
+ #endif
+ SkDebugf("\nBenchmarks still running...\n");
}
- };
- static SkThread* intentionallyLeaked = new SkThread(Loop::forever);
- intentionallyLeaked->start();
+ });
+ (void)intentionallyLeaked;
}
int main(int argc, char** argv) {