| 764 | } |
| 765 | |
| 766 | void Jrd::Attachment::releaseLocks(thread_db* tdbb) |
| 767 | { |
| 768 | // Go through relations and indices and release |
| 769 | // all existence locks that might have been taken. |
| 770 | |
| 771 | vec<jrd_rel*>* rvector = att_relations; |
| 772 | |
| 773 | if (rvector) |
| 774 | { |
| 775 | vec<jrd_rel*>::iterator ptr, end; |
| 776 | |
| 777 | for (ptr = rvector->begin(), end = rvector->end(); ptr < end; ++ptr) |
| 778 | { |
| 779 | jrd_rel* relation = *ptr; |
| 780 | |
| 781 | if (relation) |
| 782 | { |
| 783 | if (relation->rel_existence_lock) |
| 784 | { |
| 785 | LCK_release(tdbb, relation->rel_existence_lock); |
| 786 | relation->rel_flags |= REL_check_existence; |
| 787 | relation->rel_use_count = 0; |
| 788 | } |
| 789 | |
| 790 | if (relation->rel_partners_lock) |
| 791 | { |
| 792 | LCK_release(tdbb, relation->rel_partners_lock); |
| 793 | relation->rel_flags |= REL_check_partners; |
| 794 | } |
| 795 | |
| 796 | if (relation->rel_rescan_lock) |
| 797 | { |
| 798 | LCK_release(tdbb, relation->rel_rescan_lock); |
| 799 | relation->rel_flags &= ~REL_scanned; |
| 800 | } |
| 801 | |
| 802 | if (relation->rel_gc_lock) |
| 803 | { |
| 804 | LCK_release(tdbb, relation->rel_gc_lock); |
| 805 | relation->rel_flags |= REL_gc_lockneed; |
| 806 | } |
| 807 | |
| 808 | for (IndexLock* index = relation->rel_index_locks; index; index = index->idl_next) |
| 809 | { |
| 810 | if (index->idl_lock) |
| 811 | { |
| 812 | index->idl_count = 0; |
| 813 | LCK_release(tdbb, index->idl_lock); |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | for (IndexBlock* index = relation->rel_index_blocks; index; index = index->idb_next) |
| 818 | { |
| 819 | if (index->idb_lock) |
| 820 | LCK_release(tdbb, index->idb_lock); |
| 821 | } |
| 822 | } |
| 823 | } |
no test coverage detected