private void waitOnLock ( ) throws PSQLException { while ( lockedFor != null ) { try { this . wait ( ) ; } catch ( InterruptedException ie ) { Thread . currentThread ( ) . interrupt ( ) ; throw new PSQLException ( GT . tr ( "Interrupted while waiting to obtain lock on database connection" ) , PSQLState . OBJECT_NOT_IN_STATE , ie ) ; } } }
Wait until our lock is released . Execution of a single synchronized method can then continue without further ado . Must be called at beginning of each synchronized public method .