int () { //FIXME RC: this is totally incorrect now: code relies on implicit knowledge that all storages use // PagedFileStorage under the hood, and PFS uses StorageLockContext default instance. This // is not true anymore, since VFS uses either FilePageCacheLockFree or mmapped-file based // storages now: ReentrantReadWriteLock storageLock = StorageLockContext.defaultContextLock(); if (storageLock.isWriteLocked()) { return storageLock.getQueueLength() + 1; } else { int readers = storageLock.getReadLockCount(); return storageLock.getQueueLength() + readers; } }