MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / tryReadLock

Method tryReadLock

source/core/StarThread.cpp:20–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool ReadersWriterMutex::tryReadLock() {
21 MutexLocker locker(m_mutex);
22 if (m_writers || m_writeWaiters)
23 return false;
24 m_readers++;
25 return true;
26}
27
28void ReadersWriterMutex::readUnlock() {
29 MutexLocker locker(m_mutex);

Callers 1

tryLockMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected