| 820 | |
| 821 | |
| 822 | void TRA_invalidate(thread_db* tdbb, ULONG mask) |
| 823 | { |
| 824 | /************************************** |
| 825 | * |
| 826 | * T R A _ i n v a l i d a t e |
| 827 | * |
| 828 | ************************************** |
| 829 | * |
| 830 | * Functional description |
| 831 | * Invalidate any active transactions that may have |
| 832 | * modified a page that couldn't be written. |
| 833 | * |
| 834 | **************************************/ |
| 835 | |
| 836 | Database* const database = tdbb->getDatabase(); |
| 837 | |
| 838 | EngineCheckout cout(tdbb, FB_FUNCTION, EngineCheckout::UNNECESSARY); |
| 839 | |
| 840 | SyncLockGuard dbbSync(&database->dbb_sync, SYNC_SHARED, "TRA_invalidate"); |
| 841 | |
| 842 | Jrd::Attachment* attachment = database->dbb_attachments; |
| 843 | while (attachment) |
| 844 | { |
| 845 | Jrd::Attachment::SyncGuard attGuard(attachment, FB_FUNCTION); |
| 846 | |
| 847 | for (jrd_tra* transaction = attachment->att_transactions; transaction; |
| 848 | transaction = transaction->tra_next) |
| 849 | { |
| 850 | const ULONG transaction_mask = 1L << (transaction->tra_number & (BITS_PER_LONG - 1)); |
| 851 | if ((transaction_mask & mask) && (transaction->tra_flags & TRA_write)) |
| 852 | transaction->tra_flags |= TRA_invalidated; |
| 853 | } |
| 854 | |
| 855 | attachment = attachment->att_next; |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | |
| 860 | void TRA_link_cursor(jrd_tra* transaction, DsqlCursor* cursor) |
no test coverage detected