comparison src/main/java/jp/ac/u_ryukyu/treevnc/server/RequestScreenThread.java @ 88:a719aa609e14

add name valuer threads.
author oc
date Thu, 01 May 2014 19:12:05 +0900
parents 9d3478d11d3b
children 8f4c45c1b396
comparison
equal deleted inserted replaced
87:9a485070f831 88:a719aa609e14
10 10
11 public RequestScreenThread(MyRfbProto _rfb) { 11 public RequestScreenThread(MyRfbProto _rfb) {
12 rfb = _rfb; 12 rfb = _rfb;
13 } 13 }
14 14
15
16
17 /* (non-Javadoc)
18 * @see java.lang.Runnable#run()
19 *
20 * request full screen update every 3 second.
21 * restart send this immediately.
22 * nobody call this.
23 *
24 */
15 public void run() { 25 public void run() {
16 while (true) { 26 while (true) {
17 try { 27 try {
18 waitThread(); 28 synchronized(this) {
29 wait();
30 }
19 Thread.sleep(3000); 31 Thread.sleep(3000);
20 rfb.writeFramebufferUpdateRequest(0, 0, protocol.getFbWidth(), 32 rfb.writeFramebufferUpdateRequest(0, 0, protocol.getFbWidth(),
21 protocol.getFbHeight(), false); 33 protocol.getFbHeight(), false);
22 34
23 } catch (Exception e) { 35 } catch (Exception e) {
25 break; 37 break;
26 } 38 }
27 } 39 }
28 } 40 }
29 41
30 public synchronized void waitThread() {
31 try{
32 wait();
33 }catch(InterruptedException e) {
34 e.printStackTrace();
35 }
36 }
37 42
43 /**
44 * do nothing.
45 */
38 public synchronized void reStart() { 46 public synchronized void reStart() {
39 notify(); 47 notify();
40 } 48 }
41 49
42 } 50 }