Created
August 8, 2024 00:37
-
-
Save mdcallag/8ecfe34120b25cd6e78e550fb45bc3ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************//** | |
Save some CPU by testing the value of srv_thread_concurrency in inline | |
functions. */ | |
static inline | |
void | |
innobase_srv_conc_enter_innodb( | |
/*===========================*/ | |
trx_t* trx) /*!< in: transaction handle */ | |
{ | |
if (srv_thread_concurrency) { | |
if (trx->n_tickets_to_enter_innodb > 0) { | |
/* If trx has 'free tickets' to enter the engine left, | |
then use one such ticket */ | |
--trx->n_tickets_to_enter_innodb; | |
} else if (trx->mysql_thd != NULL | |
&& thd_is_replication_slave_thread(trx->mysql_thd)) { | |
UT_WAIT_FOR( | |
srv_conc_get_active_threads() | |
< srv_thread_concurrency, | |
srv_replication_delay * 1000); | |
} else { | |
srv_conc_enter_innodb(trx); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment