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

@@ -234,7 +234,8 @@ public class BlueGigaBridgeHandler extends AbstractBluetoothBridgeHandler<BlueGi
}, executor);
serialHandler = serialPortFuture
.thenApply(sp -> new BlueGigaSerialHandler(inputStream.get(), outputStream.get()));
.thenApply(sp -> new BlueGigaSerialHandler(getThing().getUID().getAsString(), inputStream.get(),
outputStream.get()));
transactionManager = serialHandler.thenApply(sh -> {
BlueGigaTransactionManager th = new BlueGigaTransactionManager(sh, executor);
sh.addHandlerListener(this);

View File

@@ -59,12 +59,12 @@ public class BlueGigaSerialHandler {
private final InputStream inputStream;
private final Thread parserThread;
public BlueGigaSerialHandler(final InputStream inputStream, final OutputStream outputStream) {
public BlueGigaSerialHandler(final String uid, final InputStream inputStream, final OutputStream outputStream) {
this.outputStream = outputStream;
this.inputStream = inputStream;
flush();
parserThread = createBlueGigaBLEHandler();
parserThread = createBlueGigaBLEHandler(uid);
parserThread.setUncaughtExceptionHandler((t, th) -> {
logger.warn("BluegigaSerialHandler terminating due to unhandled error", th);
});
@@ -323,7 +323,7 @@ public class BlueGigaSerialHandler {
logger.debug("BlueGiga BLE exited.");
}
private Thread createBlueGigaBLEHandler() {
return new Thread(this::inboundMessageHandlerLoop, "BlueGigaBLEHandler");
private Thread createBlueGigaBLEHandler(String uid) {
return new Thread(this::inboundMessageHandlerLoop, "OH-binding-" + uid + "-blueGigaBLEHandler");
}
}