Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 171:fab76dd9c3cd
avoid deadLock on surface.
author | oc |
---|---|
date | Fri, 20 Jun 2014 18:29:50 +0900 |
parents | 2c36ea3f93da |
children | 73c42f9d04a8 |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Jun 20 18:04:23 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Jun 20 18:29:50 2014 +0900 @@ -243,6 +243,7 @@ fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, true); rfb.setCuiVersion(false); + boolean visible = true; if (rect.getEncodingType() == EncodingType.INIT_DATA) { int length = reader.readInt32(); byte[] initData = new byte[length]; @@ -255,14 +256,16 @@ reader.reset(); rfb.readSendData(length + 20, reader); // size of UpdateRectangleMessage with initData. short id = (short) rect.x; - repaintController.setVisible(id != rfb.getId()); - + visible = (id != rfb.getId()); } - synchronized (renderer.getLock()) { - if(!(rfb.getCuiVersion())) - renderer = repaintController.createRenderer(reader, rect.width, rect.height,context.getPixelFormat()); - } - context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false)); + synchronized (renderer.getLock()) { + if(!(rfb.getCuiVersion())) + renderer = repaintController.createRenderer(reader, rect.width, rect.height,context.getPixelFormat()); + } + if (rect.getEncodingType() == EncodingType.INIT_DATA) { + repaintController.setVisible(visible); + } + context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false)); // repaintController.repaintCursor(); } else throw new CommonException("Unprocessed encoding: " + rect.toString());