MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / convert

Method convert

src/lock/lock.cpp:605–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603
604
605bool LockManager::convert(thread_db* tdbb,
606 CheckStatusWrapper* statusVector,
607 SRQ_PTR request_offset,
608 UCHAR type,
609 SSHORT lck_wait,
610 lock_ast_t ast_routine,
611 void* ast_argument)
612{
613/**************************************
614 *
615 * c o n v e r t
616 *
617 **************************************
618 *
619 * Functional description
620 * Perform a lock conversion, if possible.
621 *
622 **************************************/
623 LOCK_TRACE(("LM::convert (%d, %d)\n", type, lck_wait));
624
625 LockTableGuard guard(this, FB_FUNCTION, DUMMY_OWNER);
626
627 lrq* const request = get_request(request_offset);
628 const SRQ_PTR owner_offset = request->lrq_owner;
629 guard.setOwner(owner_offset);
630
631 own* const owner = (own*) SRQ_ABS_PTR(owner_offset);
632 if (!owner->own_count)
633 return false;
634
635 ++(m_sharedMemory->getHeader()->lhb_converts);
636
637 const lbl* lock = (lbl*) SRQ_ABS_PTR(request->lrq_lock);
638 if (lock->lbl_series < LCK_MAX_SERIES)
639 ++(m_sharedMemory->getHeader()->lhb_operations[lock->lbl_series]);
640 else
641 ++(m_sharedMemory->getHeader()->lhb_operations[0]);
642
643 const bool result =
644 internal_convert(tdbb, statusVector, request_offset, type, lck_wait,
645 ast_routine, ast_argument);
646
647 return result;
648}
649
650
651UCHAR LockManager::downgrade(thread_db* tdbb,

Callers 11

prepareStatementFunction · 0.45
stringBooleanMethod · 0.45
Re2SimilarMatcherMethod · 0.45
resultMethod · 0.45
resultMethod · 0.45
INTL_convert_bytesFunction · 0.45
CONVERTFunction · 0.45
internal_downgradeFunction · 0.45
internal_enqueueFunction · 0.45

Calls 2

setOwnerMethod · 0.45
getHeaderMethod · 0.45

Tested by

no test coverage detected