Add more informative thread names

This commit is contained in:
AsamK 2022-01-29 15:01:34 +01:00
parent 2e74acaabe
commit 380c892e24
4 changed files with 21 additions and 6 deletions

View file

@ -96,14 +96,16 @@ public class DbusSignalControlImpl implements org.asamk.SignalControl {
public String link(final String newDeviceName) throws Error.Failure {
try {
final URI deviceLinkUri = c.getNewProvisioningDeviceLinkUri();
new Thread(() -> {
final var thread = new Thread(() -> {
final ProvisioningManager provisioningManager = c.getProvisioningManagerFor(deviceLinkUri);
try {
provisioningManager.finishDeviceLink(newDeviceName);
} catch (IOException | TimeoutException | UserAlreadyExists e) {
e.printStackTrace();
}
}).start();
});
thread.setName("dbus-link");
thread.start();
return deviceLinkUri.toString();
} catch (TimeoutException | IOException e) {
throw new SignalControl.Error.Failure(e.getClass().getSimpleName() + " " + e.getMessage());