码迷,mamicode.com
首页 > 其他好文 > 详细

函数buf_LRU_search_and_free_block

时间:2015-11-24 01:04:34      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

 

/******************************************************************//**
Try to free a replaceable block.
@return    TRUE if found and freed */
UNIV_INTERN
ibool
buf_LRU_search_and_free_block(
/*==========================*/
    buf_pool_t*    buf_pool,
                /*!< in: buffer pool instance */
    ulint        n_iterations)
                /*!< in: how many times this has been called
                repeatedly without result: a high value means
                that we should search farther; if
                n_iterations < 10, then we search
                n_iterations / 10 * buf_pool->curr_size
                pages from the end of the LRU list; if
                n_iterations < 5, then we will also search
                n_iterations / 5 of the unzip_LRU list. */
{
    ibool    freed = FALSE;

    buf_pool_mutex_enter(buf_pool);

    freed = buf_LRU_free_from_unzip_LRU_list(buf_pool, n_iterations); //这里

    if (!freed) {
        freed = buf_LRU_free_from_common_LRU_list(buf_pool, n_iterations);//这里
    }

    if (!freed) {
        buf_pool->LRU_flush_ended = 0;
    } else if (buf_pool->LRU_flush_ended > 0) {
        buf_pool->LRU_flush_ended--;
    }

    buf_pool_mutex_exit(buf_pool);

    return(freed);
}

 

函数buf_LRU_search_and_free_block

标签:

原文地址:http://www.cnblogs.com/taek/p/4990122.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!