comparison src/myVncProxy/MulticastQueue.java @ 109:3f73ebf918bd

add time out to avoid memory overlow caused by suspended clients.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 05 Aug 2011 12:08:17 +0900
parents 0cbe556e2c54
children 7e60020f0a72
comparison
equal deleted inserted replaced
108:4199efcc4260 109:3f73ebf918bd
34 } 34 }
35 35
36 public T poll() 36 public T poll()
37 { 37 {
38 Node<T> next = null; 38 Node<T> next = null;
39 T item; 39 T item = null;
40 do { 40 do {
41 try { 41 try {
42 next = node.next(); 42 next = node.next();
43 }catch(InterruptedException _e){ 43 }catch(InterruptedException _e){
44 _e.printStackTrace(); 44 continue;
45 } 45 }
46 item = node.getItem(); 46 item = node.getItem();
47 node = next; 47 node = next;
48 } while ( item == null); 48 } while ( item == null);
49 return item; 49 return item;