[armedbear-cvs] r12076 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Wed Jul 29 19:55:07 UTC 2009


Author: ehuelsmann
Date: Wed Jul 29 15:54:50 2009
New Revision: 12076

Log:
Fix a race in the profiler startup phase.

On my hardware, the profiling value got set to 'true'
after the scheduling thread tried to run its first
loop; meaning it never set sampleNow.

Modified:
   trunk/abcl/src/org/armedbear/lisp/Profiler.java

Modified: trunk/abcl/src/org/armedbear/lisp/Profiler.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Profiler.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Profiler.java	Wed Jul 29 15:54:50 2009
@@ -47,6 +47,7 @@
     private static final Runnable profilerRunnable = new Runnable() {
         public void run()
         {
+            profiling = true; // make sure we don't fall through on the first iteration
             while (profiling) {
                 sampleNow = true;
                 try {
@@ -112,7 +113,6 @@
                     new Thread(profilerRunnable).start();
                 }
                 out._writeLine("; Profiler started.");
-                profiling = true;
             }
             return thread.nothing();
         }




More information about the armedbear-cvs mailing list