MySQL 9.1.0
Source Code Documentation
service_thd_engine_lock.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED
25#define MYSQL_SERVICE_THD_EGINE_LOCK_INCLUDED
26
27/**
28 @file include/mysql/service_thd_engine_lock.h
29 This service provides functions for storage engines to report
30 lock related activities.
31*/
32
33class THD;
34
35/** @deprecated Please use thd_report_lock_wait(self, wait_for, true) instead.
36@see thd_report_lock_wait
37Call it just when the engine find a transaction should wait another transaction
38to release a row lock.
39@param[in] self The thd session which is waiting for the lock to release
40@param[in] wait_for The session which is holding the lock
41*/
43
44/**
45Call it just when the engine find a transaction should wait another transaction
46to release a lock.
47Interface for Engine to report lock conflict.
48The caller should guarantee self and thd_wait_for does not be freed,
49while it is called.
50@param[in] self The thd session which is waiting for the lock to release
51@param[in] wait_for The session which is holding the lock
52@param[in] may_survive_prepare true: edge MAY remain even after wait_for
53 session PREPAREs its transaction,
54 false: edge CERTAINLY will be removed before
55 or during PREPARE of transaction run
56 by the wait_for session.
57*/
58void thd_report_lock_wait(THD *self, THD *wait_for, bool may_survive_prepare);
59#endif
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
bool wait_for(TCondition cond, std::chrono::steady_clock::duration max_wait)
Delays execution for at most max_wait or returns earlier if cond becomes true.
Definition: ut0ut.ic:131
void thd_report_row_lock_wait(THD *self, THD *wait_for)
Definition: sql_thd_api.cc:707
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:712