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

Function get_owner_handle

src/jrd/lck.cpp:506–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504
505
506static SLONG get_owner_handle(thread_db* tdbb, enum lck_t lock_type)
507{
508/**************************************
509 *
510 * g e t _ o w n e r _ h a n d l e
511 *
512 **************************************
513 *
514 * Functional description
515 * return the right kind of lock owner given a lock type.
516 *
517 **************************************/
518 SET_TDBB(tdbb);
519
520 SLONG handle = 0;
521
522 switch (get_owner_type(lock_type))
523 {
524 case LCK_OWNER_database:
525 handle = *LCK_OWNER_HANDLE_DBB(tdbb);
526 break;
527
528 case LCK_OWNER_attachment:
529 handle = *LCK_OWNER_HANDLE_ATT(tdbb);
530 break;
531
532 default:
533 bug_lck("Invalid lock owner type in get_owner_handle()");
534 }
535
536 if (!handle)
537 {
538 bug_lck("Invalid lock owner handle");
539 }
540
541 return handle;
542}
543
544
545static lck_owner_t get_owner_type(enum lck_t lock_type)

Callers 1

LockMethod · 0.85

Calls 5

SET_TDBBFunction · 0.85
get_owner_typeFunction · 0.85
LCK_OWNER_HANDLE_DBBFunction · 0.85
LCK_OWNER_HANDLE_ATTFunction · 0.85
bug_lckFunction · 0.85

Tested by

no test coverage detected