According to the JavaDocs for java.lang.Thread, holdsLock( Object ) is a static method in the Thread class - it returns false if the executing Thread does not hold a lock on the object specified, true if it does. Locks that the current Thread may have on the object where the method is executed are irrelevant. Bill [ August 13, 2003: Message edited by: William Brogden ]
Joined: Aug 05, 2002
Hi Bill: In that case the code below should printout "false" because amethod() is not synchronized... Right?