Creates a lock with name and using lockDir as the directory for the lock files. @param name the name of this lock. @param lockDir the directory where the lock files will be located. @param processLock whether to use file for process level locking or not.
(@NonNull String name, @NonNull File lockDir, boolean processLock)
| 67 | * @param processLock whether to use file for process level locking or not. |
| 68 | */ |
| 69 | public CopyLock(@NonNull String name, @NonNull File lockDir, boolean processLock) { |
| 70 | mCopyLockFile = new File(lockDir, name + ".lck"); |
| 71 | mThreadLock = getThreadLock(mCopyLockFile.getAbsolutePath()); |
| 72 | mFileLevelLock = processLock; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Attempts to grab the lock, blocking if already held by another thread or process. |
nothing calls this directly
no test coverage detected