aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DM.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-03-12 06:28:54 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-12 06:28:54 -0700
commitde6fc2bf464b734f35449c40421064b33cd9e2b4 (patch)
treeeb73da87b95ac479fd628f1913533248208dbd7a /dm/DM.cpp
parent172b45518a6a2c9c924cce124dcf27de88b03788 (diff)
DM: add keepalive for Valgrind bot.
Diffstat (limited to 'dm/DM.cpp')
-rw-r--r--dm/DM.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 9f3dbaba5e..9739210bc2 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -14,6 +14,7 @@
#include "SkOSFile.h"
#include "SkTHash.h"
#include "SkTaskGroup.h"
+#include "SkThreadUtils.h"
#include "Test.h"
#include "Timer.h"
@@ -515,6 +516,20 @@ static void run_enclave_and_gpu_tests(SkTArray<Task>* tasks) {
}
}
+// 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 keep_alive(void*) {
+ for (;;) {
+ static const int kSec = 300;
+#if defined(SK_BUILD_FOR_WIN)
+ Sleep(kSec * 1000);
+#else
+ sleep(kSec);
+#endif
+ SkDebugf("\nStill alive: doing science, reticulating splines...\n");
+ }
+}
+
int dm_main();
int dm_main() {
SetupCrashHandler();
@@ -524,6 +539,9 @@ int dm_main() {
SkInstCountPrintLeaksOnExit();
}
+ SkThread keepAlive(keep_alive); // This thread will just be killed by processes shutdown.
+ keepAlive.start();
+
gather_gold();
gather_srcs();