MCPcopy Create free account
hub / github.com/Tencent/MMKV / ~FileLock

Method ~FileLock

Core/InterProcessLock.cpp:30–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace mmkv {
29
30FileLock::~FileLock() {
31 if (isFileLockValid()) {
32 if (m_exclusiveLockCount > 0) {
33#ifdef MMKV_WIN32
34 // only win32 file lock requires double unlock
35 if (m_sharedLockCount > 0) {
36 platformUnLock(true);
37 }
38#endif
39 m_sharedLockCount = 0;
40 m_exclusiveLockCount = 0;
41 platformUnLock(false);
42 } else if (m_sharedLockCount > 0) {
43 m_sharedLockCount = 0;
44 platformUnLock(false);
45 }
46 }
47}
48
49bool FileLock::lock(LockType lockType) {
50 return doLock(lockType, true);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected