MCPcopy Create free account
hub / github.com/M66B/FairEmail / lock

Method lock

app/src/main/java/androidx/room/CopyLock.java:78–88  ·  view source on GitHub ↗

Attempts to grab the lock, blocking if already held by another thread or process.

()

Source from the content-addressed store, hash-verified

76 * Attempts to grab the lock, blocking if already held by another thread or process.
77 */
78 public void lock() {
79 mThreadLock.lock();
80 if (mFileLevelLock) {
81 try {
82 mLockChannel = new FileOutputStream(mCopyLockFile).getChannel();
83 mLockChannel.lock();
84 } catch (IOException e) {
85 throw new IllegalStateException("Unable to grab copy lock.", e);
86 }
87 }
88 }
89
90 /**
91 * Releases the lock.

Callers 1

verifyDatabaseFileMethod · 0.95

Calls 2

lockMethod · 0.65
getChannelMethod · 0.45

Tested by

no test coverage detected