| 603 | |
| 604 | |
| 605 | bool LockManager::convert(thread_db* tdbb, |
| 606 | CheckStatusWrapper* statusVector, |
| 607 | SRQ_PTR request_offset, |
| 608 | UCHAR type, |
| 609 | SSHORT lck_wait, |
| 610 | lock_ast_t ast_routine, |
| 611 | void* ast_argument) |
| 612 | { |
| 613 | /************************************** |
| 614 | * |
| 615 | * c o n v e r t |
| 616 | * |
| 617 | ************************************** |
| 618 | * |
| 619 | * Functional description |
| 620 | * Perform a lock conversion, if possible. |
| 621 | * |
| 622 | **************************************/ |
| 623 | LOCK_TRACE(("LM::convert (%d, %d)\n", type, lck_wait)); |
| 624 | |
| 625 | LockTableGuard guard(this, FB_FUNCTION, DUMMY_OWNER); |
| 626 | |
| 627 | lrq* const request = get_request(request_offset); |
| 628 | const SRQ_PTR owner_offset = request->lrq_owner; |
| 629 | guard.setOwner(owner_offset); |
| 630 | |
| 631 | own* const owner = (own*) SRQ_ABS_PTR(owner_offset); |
| 632 | if (!owner->own_count) |
| 633 | return false; |
| 634 | |
| 635 | ++(m_sharedMemory->getHeader()->lhb_converts); |
| 636 | |
| 637 | const lbl* lock = (lbl*) SRQ_ABS_PTR(request->lrq_lock); |
| 638 | if (lock->lbl_series < LCK_MAX_SERIES) |
| 639 | ++(m_sharedMemory->getHeader()->lhb_operations[lock->lbl_series]); |
| 640 | else |
| 641 | ++(m_sharedMemory->getHeader()->lhb_operations[0]); |
| 642 | |
| 643 | const bool result = |
| 644 | internal_convert(tdbb, statusVector, request_offset, type, lck_wait, |
| 645 | ast_routine, ast_argument); |
| 646 | |
| 647 | return result; |
| 648 | } |
| 649 | |
| 650 | |
| 651 | UCHAR LockManager::downgrade(thread_db* tdbb, |
no test coverage detected