org.apache.ignite.internal.util

## Class GridSpinReadWriteLock

- java.lang.Object
- - org.apache.ignite.internal.util.GridSpinReadWriteLock

    @GridToStringExclude
    public class GridSpinReadWriteLock
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`GridSpinReadWriteLock()`

### Method Summary

Methods
`void` `readLock()` Acquires write lock.
`void` `readUnlock()` Read unlock.
`String` `toString()`
`boolean` `tryReadLock()` Tries to acquire read lock.
`boolean` `tryWriteLock()` Tries to acquire write lock.
`boolean` `tryWriteLock(long timeout, TimeUnit unit)`
`void` `writeLock()` Acquires write lock.
`void` `writeLock0()` Acquires write lock without sleeping between unsuccessful attempts.
`boolean` `writeLockedByCurrentThread()`
`void` `writeUnlock()` Releases write lock.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridSpinReadWriteLock

    public GridSpinReadWriteLock()

### Method Detail

#### readLock

    public void readLock()

Acquires write lock.

#### tryReadLock

    public boolean tryReadLock()

Tries to acquire read lock.

Returns:
  `true` if acquired.

#### readUnlock

    public void readUnlock()

Read unlock.

#### writeLock

    public void writeLock()

Acquires write lock.

#### writeLock0

    public void writeLock0()

Acquires write lock without sleeping between unsuccessful attempts.

#### writeLockedByCurrentThread

    public boolean writeLockedByCurrentThread()

Returns:
  `True` if blocked by current thread.

#### tryWriteLock

    public boolean tryWriteLock()

Tries to acquire write lock.

Returns:
  `True` if write lock has been acquired.

#### tryWriteLock

    public boolean tryWriteLock(long timeout,
                       TimeUnit unit)
                         throws InterruptedException

Parameters:
  `timeout` - Timeout.
  `unit` - Unit.
Returns:
  `True` if write lock has been acquired.
Throws:
  `InterruptedException` - If interrupted.

#### writeUnlock

    public void writeUnlock()

Releases write lock.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017