in java/com/facebook/soloader/FileLocker.java [44:65]
private void init(File lockFile, boolean tryLock) throws IOException {
mLockFileOutputStream = new FileOutputStream(lockFile);
FileLock lock = null;
try {
if (tryLock) {
try {
lock = mLockFileOutputStream.getChannel().tryLock();
} catch (IOException e) {
// Try lock can throw an IOException (EAGAIN) while lock doesn't.
lock = null;
}
} else {
lock = mLockFileOutputStream.getChannel().lock();
}
} finally {
if (lock == null) {
mLockFileOutputStream.close();
}
}
mLock = lock;
}