MySQL  8.0.21
Source Code Documentation
delayed_plugin_initialization.h
Go to the documentation of this file.
1 /* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
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 DELAYED_PLUGIN_INITIALIZATION_INCLUDE
24 #define DELAYED_PLUGIN_INITIALIZATION_INCLUDE
25 
27 
29  public:
31 
32  /**
33  The class destructor
34  */
36 
37  /**
38  The thread handler.
39 
40  @retval 0 OK
41  @retval !=0 Error
42  */
44 
45  /**
46  Initialize a thread where the plugin services will be initialized
47 
48  @return the operation status
49  @retval 0 OK
50  @retval !=0 Error
51  */
53 
54  /**
55  Signals the plugin initialization thread that the server is ready.
56  */
57  void signal_thread_ready();
58 
59  /**
60  Wait for the initialization thread to do its job.
61  */
62  void wait_for_thread_end();
63 
64  /**
65  Signal that the read mode is set on the server.
66  */
68 
69  /**
70  Wait for the read mode to be set by the thread process.
71  */
72  void wait_for_read_mode();
73 
74  private:
75  // Delayed_initialization_thread variables
76 
77  /* Delayed_initialization_thread state */
79 
80  /* Is the server ready*/
82 
83  /* Is the read mode already set*/
85 
86  /* Thread related structures */
87 
89  // run conditions and locks
94 };
95 
96 #endif /* DELAYED_PLUGIN_INITIALIZATION_INCLUDE */
Definition: delayed_plugin_initialization.h:28
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
void signal_thread_ready()
Signals the plugin initialization thread that the server is ready.
Definition: delayed_plugin_initialization.cc:60
void wait_for_read_mode()
Wait for the read mode to be set by the thread process.
Definition: delayed_plugin_initialization.cc:87
mysql_cond_t run_cond
Definition: delayed_plugin_initialization.h:91
void wait_for_thread_end()
Wait for the initialization thread to do its job.
Definition: delayed_plugin_initialization.cc:67
Delayed_initialization_thread()
Definition: delayed_plugin_initialization.cc:42
thread_state delayed_thd_state
Definition: delayed_plugin_initialization.h:78
int initialization_thread_handler()
The thread handler.
Definition: delayed_plugin_initialization.cc:122
Definition: my_thread_bits.h:51
mysql_cond_t server_ready_cond
Definition: delayed_plugin_initialization.h:93
mysql_mutex_t server_ready_lock
Definition: delayed_plugin_initialization.h:92
void signal_read_mode_ready()
Signal that the read mode is set on the server.
Definition: delayed_plugin_initialization.cc:80
~Delayed_initialization_thread()
The class destructor.
Definition: delayed_plugin_initialization.cc:53
Definition: plugin_utils.h:42
int launch_initialization_thread()
Initialize a thread where the plugin services will be initialized.
Definition: delayed_plugin_initialization.cc:97
bool is_server_ready
Definition: delayed_plugin_initialization.h:81
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
my_thread_handle delayed_init_pthd
Definition: delayed_plugin_initialization.h:88
bool is_super_read_only_set
Definition: delayed_plugin_initialization.h:84
mysql_mutex_t run_lock
Definition: delayed_plugin_initialization.h:90