首页 > 学院 > 开发设计 > 正文

kernel_mutex--mysql5.5.18

2019-11-09 13:40:44
字体:
来源:转载
供稿:网友

MySQL innodb中,随处可见的kernel_mutex。全局锁,事务开始的一段代码段 /trx/trx0trx.c 中 trx_start()函数

/****************************************************************//**Starts a new transaction.@return    TRUE */UNIV_INTERNibooltrx_start(/*======*/    trx_t*    trx,    /*!< in: transaction */    ulint    rseg_id)/*!< in: rollback segment id; if ULINT_UNDEFINED            is passed, the system chooses the rollback segment            automatically in a round-robin fashion */{    ibool    ret;    /* Update the info whether we should skip XA steps that eat CPU time    For the duration of the transaction trx->support_xa is not reread    from thd so any changes in the value take effect in the next    transaction. This is to avoid a scenario where some undo    generated by a transaction, has XA stuff, and other undo,    generated by the same transaction, doesn't. */    trx->support_xa = thd_supports_xa(trx->mysql_thd);    mutex_enter(&kernel_mutex);    ret = trx_start_low(trx, rseg_id);    mutex_exit(&kernel_mutex);    return(ret);}

http://blog.csdn.net/zhaiwx1987/article/details/7108610


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表