MySQL 8.2.0
Source Code Documentation
backup_lock_service.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef BACKUP_LOCK_SERVICE_H
24#define BACKUP_LOCK_SERVICE_H
26#include <stddef.h>
27
28/**
29 Kind of Backup Lock to be acquired. In future we might
30 want to have weaker kinds of Backup Lock (e.g. one that
31 will allow concurrent TRUNCATE TABLE).
32*/
33
37
38#ifdef __cplusplus
39class THD;
40#define MYSQL_THD THD *
41#else
42#define MYSQL_THD void *
43#endif
44
46
47BEGIN_SERVICE_DEFINITION(mysql_backup_lock)
48
49/**
50 Service API to acquire shared Backup Lock.
51
52 @param opaque_thd Current thread context.
53 @param lock_kind Kind of lock to acquire - BACKUP_LOCK_SERVICE_DEFAULT
54 or weaker.
55 @param lock_timeout Number of seconds to wait before giving up.
56
57 @return Operation status.
58 @retval false Success
59 @retval true Failure
60*/
61
64 unsigned long /* lock_timeout*/));
65
66/**
67 Service API to release Backup Lock.
68
69 @param opaque_thd Current thread context.
70
71 @return Operation status.
72 @retval false Success
73 @retval true Failure
74*/
75
77
78END_SERVICE_DEFINITION(mysql_backup_lock)
79
80#endif /* BACKUP_LOCK_SERVICE_H */
enum_backup_lock_service_lock_kind
Kind of Backup Lock to be acquired.
Definition: backup_lock_service.h:34
@ BACKUP_LOCK_SERVICE_DEFAULT
Definition: backup_lock_service.h:35
#define MYSQL_THD
Definition: backup_lock_service.h:40
struct Backup_lock_handle_imp * Backup_lock_handle
Definition: backup_lock_service.h:45
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:35
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:128
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:111