Skip to content

Commit 305b32a

Browse files
author
zhourenjian
committed
No blocking on query of JavaScript Hotspot, so no "loading" indicator for Firefox, and Opera will be much happier.
1 parent f1e4b91 commit 305b32a

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/net/sf/j2s/core/hotspot/HotspotWorker.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -174,31 +174,31 @@ void sendLatestHotspot(long session, PrintStream ps) throws IOException {
174174
ps.write(EOL);
175175
StringBuffer strBuf = new StringBuffer();
176176
strBuf.append("ClazzLoader.updateHotspot (");
177-
long time = new Date().getTime();
178-
while (new Date().getTime() - time < 5000) {
177+
// long time = new Date().getTime();
178+
// while (new Date().getTime() - time < 5000) {
179179
String hotspotJS = InnerHotspotServer.getHotspotJavaScript(session);
180180
if (hotspotJS.length() != 0) {
181181
strBuf.append("\r\n");
182182
strBuf.append(hotspotJS);
183-
break;
184-
} else {
185-
Thread thread = new Thread(new Runnable() {
186-
public void run() {
187-
try {
188-
Thread.sleep(250);
189-
} catch (InterruptedException e) {
190-
e.printStackTrace();
191-
}
192-
}
193-
});
194-
thread.start();
195-
try {
196-
thread.join();
197-
} catch (InterruptedException e) {
198-
e.printStackTrace();
199-
}
183+
// break;
184+
// } else {
185+
// Thread thread = new Thread(new Runnable() {
186+
// public void run() {
187+
// try {
188+
// Thread.sleep(250);
189+
// } catch (InterruptedException e) {
190+
// e.printStackTrace();
191+
// }
192+
// }
193+
// });
194+
// thread.start();
195+
// try {
196+
// thread.join();
197+
// } catch (InterruptedException e) {
198+
// e.printStackTrace();
199+
// }
200200
}
201-
}
201+
// }
202202
strBuf.append("null);");
203203
ps.write(strBuf.toString().getBytes("utf-8"));
204204
}

0 commit comments

Comments
 (0)