| Author |
How can one prove that lock has been acquired on an object
|
shesh anand
Greenhorn
Joined: Feb 10, 2007
Posts: 29
|
|
|
How can one prove that lock has been acquired on an object and funny enough not on thread....stupid is not it!!!
|
 |
Nitesh Kant
Bartender
Joined: Feb 25, 2007
Posts: 1638
|
|
|
what is there to prove in it?
|
apigee, a better way to API!
|
 |
Meghna Bhardwaj
Ranch Hand
Joined: Jun 08, 2007
Posts: 109
|
|
Well, there is a static boolean holdsLock(Object obj) method, which will give you a true false if the object is locked. I just took it as a given, and didnt fight it
|
 |
Peter Chase
Ranch Hand
Joined: Oct 30, 2001
Posts: 1970
|
|
Note that Thread.holdsLock() is broken in older Java versions, including 1.4. I had used it in various assertions, and kept getting spurious assertion failures. Thread.holdsLock() works correctly in Java 6.
|
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
|
 |
 |
|
|
subject: How can one prove that lock has been acquired on an object
|
|
|