MCPcopy Create free account
hub / github.com/Tencent/MMKV / fcntlUnLock

Method fcntlUnLock

Core/InterProcessLock_Android.cpp:94–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94bool FileLock::fcntlUnLock(bool unlockToSharedLock) {
95 m_lockInfo.l_type = static_cast<short>(unlockToSharedLock ? F_RDLCK : F_UNLCK);
96 auto FcntlLockOp = m_isAshmem ? F_SETLK : F_OFD_SETLK;
97 auto ret = fcntl(m_fd, FcntlLockOp, &m_lockInfo);
98 if (ret != 0) {
99 MMKVError("fail to unlock fd=%d, ret=%d, error:%s", m_fd, ret, strerror(errno));
100 return false;
101 } else {
102 return true;
103 }
104}
105
106} // namespace mmkv
107

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected