migrate legacy mmap ID to normal ID

This commit is contained in:
guoling
2024-12-03 19:25:03 +08:00
parent 6f12ab05f0
commit 147f89dba7
11 changed files with 170 additions and 65 deletions
-3
View File
@@ -30,9 +30,6 @@ namespace mmkv {
FileLock::FileLock(MMKVFileHandle_t fd, bool isAshmem, int64_t lockPos, int64_t lockLen)
: m_fd(fd), m_sharedLockCount(0), m_exclusiveLockCount(0), m_isAshmem(isAshmem), m_lockInfo() {
// locking with pos & len only works in ashmem lock type (fcntl)
assert(isAshmem || (lockPos == 0 && lockLen == 0));
m_lockInfo.l_type = F_WRLCK;
m_lockInfo.l_start = lockPos;
m_lockInfo.l_whence = SEEK_SET;