public static void assertUnlocked ( Object object , String name ) { if ( RUNTIME_ASSERTIONS ) { if ( Thread . holdsLock ( object ) ) { throw new RuntimeAssertion ( "Recursive lock of %s" , name ) ; } } }
This is an assertion method that can be used by a thread to confirm that the thread isn t already holding lock for an object before acquiring a lock