# Class: com.pnfsoftware.jeb.util.concurrent.SafeLockImpl

Standard implementation of a safe lock, using a serializable reentrant read\-write lock. It is highly recommended to use this lock through the safe interface [ISafeLock](ISafeLock). Direct use of non\-auto\-closable methods is not recommended.

## Constructor: SafeLockImpl

Description: Create a safe read\-write lock.

## Method: debugFormatStatus
- return type: `java.lang.String`


## Method: getInternalLock
- return type: `java.util.concurrent.locks.ReentrantReadWriteLock`

Description: Get the underlying read\-write lock.
return: the internal lock

## Method: lock
- parameter: `forWriting`, type: `boolean`

Description: Acquire either the read or write lock.
parameter: forWriting: true to acquire the write lock; false to acquire the read lock

## Method: lockRead

Description: Acquire the read lock.

## Method: lockWrite

Description: Acquire the write lock.
throws: if the current thread is attempting an unsupported read\-to\-write             lock upgrade

## Method: ro
- return type: `com.pnfsoftware.jeb.util.concurrent.ACLock`

Description: Acquire an auto\-closable read lock.
return: an acquired read lock

## Method: rw
- return type: `com.pnfsoftware.jeb.util.concurrent.ACLock`

Description: Acquire an auto\-closable write lock.
return: an acquired write lock

## Method: unlock
- parameter: `forWriting`, type: `boolean`

Description: Release either the read or write lock.
parameter: forWriting: true to release the write lock; false to release the read lock

## Method: unlockRead

Description: Release a read lock held by the current thread.

## Method: unlockWrite

Description: Release the write lock held by the current thread.

