diff options
author | monty@donna.mysql.fi <> | 2001-04-19 14:43:32 +0300 |
---|---|---|
committer | monty@donna.mysql.fi <> | 2001-04-19 14:43:32 +0300 |
commit | 566f82369c62ece3d1804b30e18d0e0d1bc38c21 (patch) | |
tree | fcdeec62c24b863cfe8fe65bb23158d45002f726 /innobase/que | |
parent | f113a7fd647ccfebbc8f7e02a2bc169cbb6f82e4 (diff) | |
download | mariadb-git-566f82369c62ece3d1804b30e18d0e0d1bc38c21.tar.gz |
Portability fixes
Diffstat (limited to 'innobase/que')
-rw-r--r-- | innobase/que/que0que.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index b2c7e3ceea8..ddf8c8ebc43 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -1068,6 +1068,51 @@ que_thr_stop_for_mysql( mutex_exit(&kernel_mutex); } + +/************************************************************************** +Moves a thread from another state to the QUE_THR_RUNNING state. Increments +the n_active_thrs counters of the query graph and transaction if thr was +not active. */ +void +que_thr_move_to_run_state_for_mysql( +/*================================*/ + que_thr_t* thr, /* in: an query thread */ + trx_t* trx) /* in: transaction */ +{ + if (!thr->is_active) { + + (thr->graph)->n_active_thrs++; + + trx->n_active_thrs++; + + thr->is_active = TRUE; + + ut_ad((thr->graph)->n_active_thrs == 1); + ut_ad(trx->n_active_thrs == 1); + } + + thr->state = QUE_THR_RUNNING; +} + +/************************************************************************** +A patch for MySQL used to 'stop' a dummy query thread used in MySQL +select, when there is no error or lock wait. */ +void +que_thr_stop_for_mysql_no_error( +/*============================*/ + que_thr_t* thr, /* in: query thread */ + trx_t* trx) /* in: transaction */ +{ + ut_ad(thr->state == QUE_THR_RUNNING); + + thr->state = QUE_THR_COMPLETED; + + thr->is_active = FALSE; + (thr->graph)->n_active_thrs--; + + trx->n_active_thrs--; +} + /************************************************************************** Prints info of an SQL query graph node. */ |