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

Method repost

src/lock/lock.cpp:754–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752
753
754void LockManager::repost(thread_db* tdbb, lock_ast_t ast, void* arg, SRQ_PTR owner_offset)
755{
756/**************************************
757 *
758 * r e p o s t
759 *
760 **************************************
761 *
762 * Functional description
763 * Re-post an AST that was previously blocked.
764 * It is assumed that the routines that look
765 * at the re-post list only test the ast element.
766 *
767 **************************************/
768 LOCK_TRACE(("LM::repost (%ld)\n", owner_offset));
769
770 if (!owner_offset)
771 return;
772
773 LockTableGuard guard(this, FB_FUNCTION, owner_offset);
774
775 // Allocate or reuse a lock request block
776
777 lrq* request;
778
779 ASSERT_ACQUIRED;
780 if (SRQ_EMPTY(m_sharedMemory->getHeader()->lhb_free_requests))
781 {
782 if (!(request = (lrq*) alloc(sizeof(lrq), NULL)))
783 {
784 return;
785 }
786 }
787 else
788 {
789 ASSERT_ACQUIRED;
790 request = (lrq*) ((UCHAR*) SRQ_NEXT(m_sharedMemory->getHeader()->lhb_free_requests) -
791 offsetof(lrq, lrq_lbl_requests));
792 remove_que(&request->lrq_lbl_requests);
793 }
794
795 request->lrq_type = type_lrq;
796 request->lrq_flags = LRQ_repost;
797 request->lrq_ast_routine = ast;
798 request->lrq_ast_argument = arg;
799 request->lrq_requested = LCK_none;
800 request->lrq_state = LCK_none;
801 request->lrq_owner = owner_offset;
802 request->lrq_lock = 0;
803
804 own* const owner = (own*) SRQ_ABS_PTR(owner_offset);
805 insert_tail(&owner->own_blocks, &request->lrq_own_blocks);
806 SRQ_INIT(request->lrq_own_pending);
807
808 DEBUG_DELAY;
809
810 if (!(owner->own_flags & OWN_signaled))
811 signal_owner(tdbb, owner);

Callers 1

LCK_re_postFunction · 0.80

Calls 1

getHeaderMethod · 0.45

Tested by

no test coverage detected