MySQL  8.0.27
Source Code Documentation
service_thd_engine_lock.h
Go to the documentation of this file.
1 /* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED
24 #define MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED
25 
26 /**
27  @file include/mysql/service_thd_engine_lock.h
28  This service provides functions for storage engines to report
29  lock related activities.
30 */
31 
32 class THD;
33 
34 /** @deprecated Please use thd_report_lock_wait(self, wait_for, true) instead.
35 @see thd_report_lock_wait
36 Call it just when the engine find a transaction should wait another transaction
37 to release a row lock.
38 @param[in] self The thd session which is waiting for the lock to release
39 @param[in] wait_for The session which is holding the lock
40 */
41 void thd_report_row_lock_wait(THD *self, THD *wait_for);
42 
43 /**
44 Call it just when the engine find a transaction should wait another transaction
45 to release a lock.
46 Interface for Engine to report lock conflict.
47 The caller should guarantee self and thd_wait_for does not be freed,
48 while it is called.
49 @param[in] self The thd session which is waiting for the lock to release
50 @param[in] wait_for The session which is holding the lock
51 @param[in] may_survive_prepare true: edge MAY remain even after wait_for
52  session PREPAREs its transaction,
53  false: edge CERTAINLY will be removed before
54  or during PREPARE of transaction run
55  by the wait_for session.
56 */
57 void thd_report_lock_wait(THD *self, THD *wait_for, bool may_survive_prepare);
58 #endif
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:821
void thd_report_row_lock_wait(THD *self, THD *wait_for)
Definition: sql_thd_api.cc:631
void thd_report_lock_wait(THD *self, THD *wait_for, bool may_survive_prepare)
Call it just when the engine find a transaction should wait another transaction to release a lock.
Definition: sql_thd_api.cc:636