MySQL 8.4.2
Source Code Documentation
backup_lock_service.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef BACKUP_LOCK_SERVICE_H
25#define BACKUP_LOCK_SERVICE_H
27#include <stddef.h>
28
29/**
30 Kind of Backup Lock to be acquired. In future we might
31 want to have weaker kinds of Backup Lock (e.g. one that
32 will allow concurrent TRUNCATE TABLE).
33*/
34
38
39#ifdef __cplusplus
40class THD;
41#define MYSQL_THD THD *
42#else
43#define MYSQL_THD void *
44#endif
45
47
48BEGIN_SERVICE_DEFINITION(mysql_backup_lock)
49
50/**
51 Service API to acquire shared Backup Lock.
52
53 @param opaque_thd Current thread context.
54 @param lock_kind Kind of lock to acquire - BACKUP_LOCK_SERVICE_DEFAULT
55 or weaker.
56 @param lock_timeout Number of seconds to wait before giving up.
57
58 @return Operation status.
59 @retval false Success
60 @retval true Failure
61*/
62
65 unsigned long /* lock_timeout*/));
66
67/**
68 Service API to release Backup Lock.
69
70 @param opaque_thd Current thread context.
71
72 @return Operation status.
73 @retval false Success
74 @retval true Failure
75*/
76
78
79END_SERVICE_DEFINITION(mysql_backup_lock)
80
81#endif /* BACKUP_LOCK_SERVICE_H */
enum_backup_lock_service_lock_kind
Kind of Backup Lock to be acquired.
Definition: backup_lock_service.h:35
@ BACKUP_LOCK_SERVICE_DEFAULT
Definition: backup_lock_service.h:36
#define MYSQL_THD
Definition: backup_lock_service.h:41
struct Backup_lock_handle_imp * Backup_lock_handle
Definition: backup_lock_service.h:46
enum enum_backup_lock_service_lock_kind backup_lock_service_lock_kind
Kind of Backup Lock to be acquired.
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:129
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112