Normalized thread names (#9581)

Related to #8216

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
This commit is contained in:
Hilbrand Bouwkamp
2021-01-12 22:10:01 +01:00
committed by GitHub
parent 79dfb43e42
commit ac3f907b36
22 changed files with 75 additions and 43 deletions

View File

@@ -27,11 +27,8 @@ class Utils {
}
static Thread backgroundThread(Runnable r, String type, @Nullable Thing thing) {
String name = "OH-binding-" + LinuxInputBindingConstants.BINDING_ID + "-" + type;
if (thing != null) {
name += "-" + thing.getUID();
}
Thread t = new Thread(r, name);
String id = thing == null ? LinuxInputBindingConstants.BINDING_ID : thing.getUID().getAsString();
Thread t = new Thread(r, "OH-binding-" + id + "-" + type);
t.setDaemon(true);
return t;
}