2002/07/20 04:07:26
[org.ibex.core.git] / src / org / xwt / TinySSL.java
index d036d33..637e41c 100644 (file)
@@ -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 {