TaskRunner: name the threads
Inheriting the name from the calling thread can be confusing
sometimes.
Test: manual
Change-Id: Ib35435f553aad9f1ac4b2397d62399d3b23131e3
diff --git a/base/TaskRunner.cpp b/base/TaskRunner.cpp
index d4357bf..bd42240 100644
--- a/base/TaskRunner.cpp
+++ b/base/TaskRunner.cpp
@@ -16,6 +16,7 @@
#include <hidl/TaskRunner.h>
+#include <utils/AndroidThreads.h>
#include "SynchronizedQueue.h"
#include <thread>
@@ -49,6 +50,8 @@
// Allow the thread to continue running in background;
// TaskRunner do not care about the std::thread object.
std::thread{[q = mQueue] {
+ androidSetThreadName("HIDL TaskRunner");
+
Task nextTask;
while (!!(nextTask = q->wait_pop())) {
nextTask();