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

Method FileLock

Core/InterProcessLock_Android.cpp:31–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace mmkv {
30
31FileLock::FileLock(MMKVFileHandle_t fd, bool useFcntlLock, bool isAshmem, int64_t lockPos, int64_t lockLen)
32 : m_fd(fd), m_sharedLockCount(0), m_exclusiveLockCount(0), m_useFcntlLock(useFcntlLock), m_isAshmem(isAshmem),
33 m_lockInfo() {
34 m_lockInfo.l_type = F_WRLCK;
35 m_lockInfo.l_start = lockPos;
36 m_lockInfo.l_whence = SEEK_SET;
37 m_lockInfo.l_len = lockLen;
38 m_lockInfo.l_pid = 0;
39}
40
41static short LockType2FlockType(LockType lockType) {
42 switch (lockType) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected