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

Method platformUnLock

Core/InterProcessLock.cpp:147–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147bool FileLock::platformUnLock(bool unlockToSharedLock) {
148# ifdef MMKV_ANDROID
149 if (m_useFcntlLock) {
150 return fcntlUnLock(unlockToSharedLock);
151 }
152# endif
153 int cmd = unlockToSharedLock ? LOCK_SH : LOCK_UN;
154 if (flock(m_fd, cmd) != 0) {
155 MMKVError("fail to unlock fd=%d, error:%d(%s)", m_fd, errno, strerror(errno));
156 return false;
157 }
158 return true;
159}
160
161#endif // MMKV_WIN32
162

Callers

nothing calls this directly

Calls 1

flockClass · 0.85

Tested by

no test coverage detected