[sonyprojector] Fix handling of InterruptedException (Thread.sleep) (#10458)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2021-04-06 08:47:20 +02:00 committed by GitHub
parent c9c52124e9
commit a509c3b638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -950,9 +950,13 @@ public abstract class SonyProjectorConnector {
if (!runningSession) { if (!runningSession) {
close(); close();
} }
} catch (SonyProjectorException | InterruptedException e) { } catch (SonyProjectorException e) {
logger.debug("Send IR {} failed: {}", item.getName(), e.getMessage()); logger.debug("Send IR {} failed: {}", item.getName(), e.getMessage());
throw new SonyProjectorException("Send IR " + item.getName() + " failed: " + e.getMessage()); throw new SonyProjectorException("Send IR " + item.getName() + " failed: " + e.getMessage());
} catch (InterruptedException e) {
logger.debug("Send IR {} interrupted: {}", item.getName(), e.getMessage());
Thread.currentThread().interrupt();
throw new SonyProjectorException("Send IR " + item.getName() + " interrupted: " + e.getMessage());
} }
logger.debug("Send IR {} succeeded", item.getName()); logger.debug("Send IR {} succeeded", item.getName());

View File

@ -302,6 +302,7 @@ public class SonyProjectorSerialConnector extends SonyProjectorConnector impleme
logger.debug("RXTX library CPU load workaround, sleep forever"); logger.debug("RXTX library CPU load workaround, sleep forever");
Thread.sleep(Long.MAX_VALUE); Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt();
} }
} }
} }