// 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");
- }
+static void start_keepalive() {
+ struct Loop {
+ static void forever(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");
+ }
+ }
+ };
+ static SkThread* intentionallyLeaked = new SkThread(Loop::forever);
+ intentionallyLeaked->start();
}
int dm_main();
SkInstCountPrintLeaksOnExit();
}
- SkThread keepAlive(keep_alive); // This thread will just be killed by processes shutdown.
- keepAlive.start();
+ start_keepalive();
gather_gold();