| 718 | } |
| 719 | |
| 720 | inline void waitGCActive(thread_db* tdbb, const record_param* rpb) |
| 721 | { |
| 722 | Lock temp_lock(tdbb, sizeof(SINT64), LCK_record_gc); |
| 723 | temp_lock.setKey(((SINT64) rpb->rpb_page << 16) | rpb->rpb_line); |
| 724 | |
| 725 | SSHORT wait = LCK_WAIT; |
| 726 | |
| 727 | jrd_tra* transaction = tdbb->getTransaction(); |
| 728 | if (transaction->tra_number == rpb->rpb_transaction_nr) |
| 729 | { |
| 730 | // There is no sense to wait for self |
| 731 | wait = LCK_NO_WAIT; |
| 732 | } |
| 733 | |
| 734 | if (!LCK_lock(tdbb, &temp_lock, LCK_SR, wait)) |
| 735 | ERR_punt(); |
| 736 | |
| 737 | LCK_release(tdbb, &temp_lock); |
| 738 | } |
| 739 | |
| 740 | inline Lock* lockGCActive(thread_db* tdbb, const jrd_tra* transaction, const record_param* rpb) |
| 741 | { |
no test coverage detected