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

Function LCK_init

src/jrd/lck.cpp:600–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598
599
600void LCK_init(thread_db* tdbb, enum lck_owner_t owner_type)
601{
602/**************************************
603 *
604 * L C K _ i n i t
605 *
606 **************************************
607 *
608 * Functional description
609 * Initialize the locking stuff for the given owner.
610 *
611 **************************************/
612 LOCK_OWNER_T owner_id;
613 SLONG* owner_handle_ptr = 0;
614
615 SET_TDBB(tdbb);
616 Database* const dbb = tdbb->getDatabase();
617
618 switch (owner_type)
619 {
620 case LCK_OWNER_database:
621 owner_id = LCK_OWNER_ID_DBB(tdbb);
622 owner_handle_ptr = LCK_OWNER_HANDLE_DBB(tdbb);
623 break;
624
625 case LCK_OWNER_attachment:
626 owner_id = LCK_OWNER_ID_ATT(tdbb);
627 owner_handle_ptr = LCK_OWNER_HANDLE_ATT(tdbb);
628 break;
629
630 default:
631 bug_lck("Invalid lock owner type in LCK_init ()");
632 break;
633 }
634
635 FbLocalStatus statusVector;
636
637 if (!dbb->lockManager()->initializeOwner(&statusVector, owner_id, owner_type, owner_handle_ptr))
638 {
639 if (statusVector[1] == isc_lockmanerr)
640 {
641 statusVector.copyTo(tdbb->tdbb_status_vector);
642 tdbb->getDatabase()->dbb_flags |= DBB_bugcheck;
643 }
644
645 statusVector.raise();
646 }
647}
648
649
650bool LCK_lock(thread_db* tdbb, Lock* lock, USHORT level, SSHORT wait)

Callers 6

internalAttachMethod · 0.85
createDatabaseMethod · 0.85
cache_readerMethod · 0.85
cache_writerMethod · 0.85
garbage_collectorMethod · 0.85

Calls 11

SET_TDBBFunction · 0.85
LCK_OWNER_ID_DBBFunction · 0.85
LCK_OWNER_HANDLE_DBBFunction · 0.85
LCK_OWNER_ID_ATTFunction · 0.85
LCK_OWNER_HANDLE_ATTFunction · 0.85
bug_lckFunction · 0.85
getDatabaseMethod · 0.80
initializeOwnerMethod · 0.80
lockManagerMethod · 0.80
copyToMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected