Searched refs:lockScope (Results 1 – 9 of 9) sorted by relevance
52 LockScope lockScope = LockScope.createWithExistingThreadLocks(lockMap); in createWithSharedThreadLocks_sharesThreadLocksAcrossInstances() local56 try (Lock lock = lockScope.threadLock(uri)) { in createWithSharedThreadLocks_sharesThreadLocksAcrossInstances()65 LockScope lockScope = LockScope.createWithFailingThreadLocks(); in createWithFailingThreadLocks_willFailToAcquireThreadLocks() local68 assertThrows(UnsupportedFileStorageOperation.class, () -> lockScope.threadLock(uri)); in createWithFailingThreadLocks_willFailToAcquireThreadLocks()69 assertThat(lockScope.tryThreadLock(uri)).isNull(); in createWithFailingThreadLocks_willFailToAcquireThreadLocks()74 LockScope lockScope = LockScope.create(); in createFileLockSucceedsInSingleProcess() local78 Lock lock = lockScope.fileLock(stream.getChannel(), /* shared= */ false)) { in createFileLockSucceedsInSingleProcess()
85 assertThat(backend.lockScope()).isNotNull(); in lockScope_returnsNonNullLockScope()90 LockScope lockScope = new LockScope(); in lockScope_canBeOverridden() local91 backend = new JavaFileBackend(lockScope); in lockScope_canBeOverridden()92 assertThat(backend.lockScope()).isSameInstanceAs(lockScope); in lockScope_canBeOverridden()
332 assertThat(backend.lockScope()).isNotNull(); in lockScope_returnsNonNullLockScope()337 LockScope lockScope = new LockScope(); in lockScope_canBeOverridden() local339 AndroidFileBackend.builder(context).setLockScope(lockScope).build(); in lockScope_canBeOverridden()340 assertThat(backend.lockScope()).isSameInstanceAs(lockScope); in lockScope_canBeOverridden()
38 private final LockScope lockScope; field in JavaFileBackend49 public JavaFileBackend(LockScope lockScope) { in JavaFileBackend() argument50 this.lockScope = lockScope; in JavaFileBackend()178 public LockScope lockScope() throws IOException { in lockScope() method in JavaFileBackend179 return lockScope; in lockScope()
84 private LockScope lockScope = new LockScope(); field in AndroidFileBackend.Builder118 public Builder setLockScope(LockScope lockScope) { in setLockScope() argument124 this.lockScope = lockScope; in setLockScope()134 backend = builder.backend != null ? builder.backend : new JavaFileBackend(builder.lockScope); in AndroidFileBackend()
143 return openContext.backend().lockScope().tryThreadLock(lockUri); in openThreadLock()145 return openContext.backend().lockScope().threadLock(lockUri); in openThreadLock()168 return openContext.backend().lockScope().tryFileLock(channel, shared); in openFileLock()170 return openContext.backend().lockScope().fileLock(channel, shared); in openFileLock()
130 public LockScope lockScope() throws IOException { in lockScope() method in ForwardingBackend131 return delegate().lockScope(); in lockScope()
189 default LockScope lockScope() throws IOException { in lockScope() method
264 public LockScope lockScope() throws IOException { in lockScope() method in FakeFileBackend265 return delegate.lockScope(); in lockScope()