[rvm-research] Bug: Locks returned from thread cachedFreeLock are not marked active

Carl Ritson <[email protected]>
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <CAKDym5MXncMY_CFoi6V2vS1rUgQfsdckppEggivvanCTSXY1Yg@mail.gmail.com>
Hi,

I noticed that in the code path for Lock.allocate() which returns a
cached lock from RVMThread's cachedFreeLock the lock returned is not
marked active.  The only impact of this as far as I can tell is that
many locks will not be reported via dumpLocks(), for example when the
VM fails.  This can hamper debugging, but that's all.

Attached is a one line diff to fix this bug.

Kind regards,

Carl

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
cached-log-active.diff (application/octet-stream, 455 B)
diff -r f24912e3a27e rvm/src/org/jikesrvm/scheduler/Lock.java
--- a/rvm/src/org/jikesrvm/scheduler/Lock.java	Mon Apr 22 15:19:07 2013 +1000
+++ b/rvm/src/org/jikesrvm/scheduler/Lock.java	Tue Apr 23 16:19:14 2013 +0100
@@ -468,6 +468,7 @@
         VM.sysWriteln("Lock.allocate: returning ",Magic.objectAsAddress(l),
                       ", a cached free lock from Thread #",me.getThreadSlot());
       }
+      l.active = true;
       return l;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.