Search in sources :

Example 1 with ClosableLock

use of org.metaborg.util.concurrent.ClosableLock in project spoofax by metaborg.

the class IndexTaskContext method readLock.

private IClosableLock readLock() {
    final Lock readLock = lock.readLock();
    final IClosableLock lock = new ClosableLock(readLock);
    return lock;
}
Also used : IClosableLock(org.metaborg.util.concurrent.IClosableLock) ClosableLock(org.metaborg.util.concurrent.ClosableLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) Lock(java.util.concurrent.locks.Lock) ClosableLock(org.metaborg.util.concurrent.ClosableLock)

Example 2 with ClosableLock

use of org.metaborg.util.concurrent.ClosableLock in project spoofax by metaborg.

the class IndexTaskContext method writeLock.

private IClosableLock writeLock() {
    final Lock writeLock = lock.writeLock();
    final IClosableLock lock = new ClosableLock(writeLock);
    return lock;
}
Also used : IClosableLock(org.metaborg.util.concurrent.IClosableLock) ClosableLock(org.metaborg.util.concurrent.ClosableLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) Lock(java.util.concurrent.locks.Lock) ClosableLock(org.metaborg.util.concurrent.ClosableLock)

Example 3 with ClosableLock

use of org.metaborg.util.concurrent.ClosableLock in project spoofax by metaborg.

the class AbstractScopeGraphContext method writeLock.

private IClosableLock writeLock() {
    final Lock writeLock = lock.writeLock();
    final IClosableLock lock = new ClosableLock(writeLock);
    return lock;
}
Also used : ClosableLock(org.metaborg.util.concurrent.ClosableLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) Lock(java.util.concurrent.locks.Lock) ClosableLock(org.metaborg.util.concurrent.ClosableLock) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock)

Example 4 with ClosableLock

use of org.metaborg.util.concurrent.ClosableLock in project spoofax by metaborg.

the class AbstractScopeGraphContext method readLock.

private IClosableLock readLock() {
    final Lock readLock = lock.readLock();
    final IClosableLock lock = new ClosableLock(readLock);
    return lock;
}
Also used : ClosableLock(org.metaborg.util.concurrent.ClosableLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) Lock(java.util.concurrent.locks.Lock) ClosableLock(org.metaborg.util.concurrent.ClosableLock) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) IClosableLock(org.metaborg.util.concurrent.IClosableLock)

Aggregations

Lock (java.util.concurrent.locks.Lock)4 ReadWriteLock (java.util.concurrent.locks.ReadWriteLock)4 ReentrantReadWriteLock (java.util.concurrent.locks.ReentrantReadWriteLock)4 ClosableLock (org.metaborg.util.concurrent.ClosableLock)4 IClosableLock (org.metaborg.util.concurrent.IClosableLock)4