Skip to content

Commit

Permalink
[sonyprojector] Fix handling of InterruptedException (Thread.sleep) (o…
Browse files Browse the repository at this point in the history
…penhab#10458)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored Apr 6, 2021
1 parent 5b97857 commit 16b9e25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -950,9 +950,13 @@ private synchronized void sendIR(SonyProjectorItem item) throws SonyProjectorExc
if (!runningSession) {
close();
}
} catch (SonyProjectorException | InterruptedException e) {
} catch (SonyProjectorException e) {
logger.debug("Send IR {} failed: {}", item.getName(), 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ public void serialEvent(SerialPortEvent serialPortEvent) {
logger.debug("RXTX library CPU load workaround, sleep forever");
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}

0 comments on commit 16b9e25

Please sign in to comment.