X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTinySSL.java;h=637e41c7d15064f7ce8f1e90fa42fba172261f9d;hb=937a064e3217ad35dff63cabf16f5df67dfa0954;hp=d036d3378d22049da920bd2e6ef5727192b4695d;hpb=0ebe2621238836dde71ac1fbc4800e8729bffe1b;p=org.ibex.core.git diff --git a/src/org/xwt/TinySSL.java b/src/org/xwt/TinySSL.java index d036d33..637e41c 100644 --- a/src/org/xwt/TinySSL.java +++ b/src/org/xwt/TinySSL.java @@ -1479,7 +1479,15 @@ public class TinySSL extends Socket { volatile boolean stop = false; byte counter = 0; entropySpinner() { start(); } - public void run() { while (!stop) counter++; } + public void run() { + while (true) { + // without this synchronization, GCJ will over-optimize this loop into an infinite loop. Argh. + synchronized(this) { + counter++; + if (stop) return; + } + } + } } static {