函数lock_rec_get_first

时间:2024-11-06 10:36:02
/*********************************************************************//**
Gets the first explicit lock request on a record.
@return    first lock, NULL if none exists */
UNIV_INLINE
lock_t*
lock_rec_get_first(
/*===============*/
    const buf_block_t*    block,    /*!< in: block containing the record */
    ulint            heap_no)/*!< in: heap number of the record */
{
    lock_t*    lock;

    //lock_rec_get_first_on_page 函数实现    //lock_reg_get_nth_bit  查看某记录是否已加锁 函数实现    for (lock = lock_rec_get_first_on_page(block); lock; lock = lock_rec_get_next_on_page(lock)) {
        if (lock_rec_get_nth_bit(lock, heap_no)) {
            break;
        }
    }

    return(lock);
}