CDV ❯ toString on a shared, already acquired lock, doesn't work
-
Bug
-
Status: Closed
-
3 Minor
-
Resolution: Fixed
-
-
-
asingh
-
Reporter: catac
-
September 11, 2008
-
0
-
Watchers: 1
-
July 27, 2012
-
March 16, 2009
Description
toString() on a shared, already acquired lock (ReentrantLock) fails with the following exception:
******************************************************************************* You have attempted to invoke an unsupported API in this Terracotta product. Please consult the product documentation, or email [email protected] for assistance. *******************************************************************************
at java.util.concurrent.locks.ReentrantLock.getOwner(Unknown Source)
at java.util.concurrent.locks.ReentrantLock.getLockState(Unknown Source)
at java.util.concurrent.locks.ReentrantLock.toString(Unknown Source)
at tutorial.InterruptibleLocking2.run(InterruptibleLocking2.java:19)
at java.lang.Thread.run(Thread.java:619)
Comments
Tim Eck 2009-03-04
Alex Miller 2009-03-10
Trying to even out some load. Geert if you had some stuff on this, let Abhishek know.
Abhishek Singh 2009-03-16
Fixed in rev-12158 in trunk.
toString() will now print “[Locked by current thread]” or “[Locked by other thread]” or “[Unlocked]”.
NOTE: The toString() method depends on isLocked() and therefore might not give accurate state of the lock. See CDV-859
Doh…What do you think the solution is Geert? Change how toString() is implemented in the managed case or somehow support getOwner()? The former is my first guess w/o thinking too hard about it