MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / fastlock_free

Function fastlock_free

src/fastlock.cpp:472–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470#endif
471
472extern "C" void fastlock_free(struct fastlock *lock)
473{
474 // NOP
475 serverAssert((lock->m_ticket.m_active == lock->m_ticket.m_avail) // Assert the lock is unlocked
476 || (lock->m_pidOwner == gettid()
477 && (lock->m_ticket.m_active == static_cast<uint16_t>(lock->m_ticket.m_avail-1U)))); // OR we own the lock and nobody else is waiting
478 lock->m_pidOwner = -2; // sentinal value indicating free
479 ANNOTATE_RWLOCK_DESTROY(lock);
480}
481
482
483bool fastlock::fOwnLock()

Callers 3

aeDeleteEventLoopFunction · 0.85
freeClientFunction · 0.85
freeFakeClientFunction · 0.85

Calls 1

gettidFunction · 0.85

Tested by

no test coverage detected