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

Method ThreadLock

Core/ThreadLock.cpp:30–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace mmkv {
29
30ThreadLock::ThreadLock() : m_lock({}) {
31 pthread_mutexattr_t attr;
32 pthread_mutexattr_init(&attr);
33 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
34
35 pthread_mutex_init(&m_lock, &attr);
36
37 pthread_mutexattr_destroy(&attr);
38}
39
40ThreadLock::~ThreadLock() {
41 pthread_mutex_unlock(&m_lock);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected