Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
715d404e
Commit
715d404e
authored
Feb 16, 2011
by
Mikael Ronström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More work on interfaces
parent
e5b98b91
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
8 deletions
+51
-8
include/mysql/thread_pool_priv.h
include/mysql/thread_pool_priv.h
+11
-8
sql/mysqld.cc
sql/mysqld.cc
+8
-0
sql/sql_class.cc
sql/sql_class.cc
+32
-0
No files found.
include/mysql/thread_pool_priv.h
View file @
715d404e
...
...
@@ -59,6 +59,7 @@ bool thd_is_transaction_active(THD *thd);
int
thd_connection_has_data
(
THD
*
thd
);
void
thd_set_net_read_write
(
THD
*
thd
,
uint
val
);
void
thd_set_mysys_var
(
THD
*
thd
,
st_my_thread_var
*
mysys_var
);
my_socket
thd_get_fd
(
THD
*
thd
);
/*
The thread pool must be able to execute commands using the connection
...
...
@@ -85,14 +86,16 @@ bool init_new_connection_handler_thread();
/*
thread_created is maintained by thread pool when activated since
user threads are created by the thread pool (and also special
threads to maintain the thread pool).
threads to maintain the thread pool). This is done through
inc_thread_created.
max_connections is needed to calculate the maximum number of threads
that is allowed to be started by the thread pool.
that is allowed to be started by the thread pool. The method
get_max_connections() gets reference to this variable.
connection_attrib is the thread attributes for connection threads,
the method get_connection_attrib provides a reference to these
attributes.
*/
extern
MYSQL_PLUGIN_IMPORT
ulong
thread_created
;
extern
MYSQL_PLUGIN_IMPORT
ulong
max_connections
;
extern
MYSQL_PLUGIN_IMPORT
mysql_cond_t
COND_thread_count
;
extern
MYSQL_PLUGIN_IMPORT
pthread_attr_t
connection_attrib
;
/* extern MYSQL_PLUGIN_IMPORT I_List<THD> threads; */
extern
MYSQL_PLUGIN_IMPORT
PSI_thread_key
key_thread_one_connection
;
pthread_attr_t
*
get_connection_attrib
(
void
);
void
inc_thread_created
(
void
);
ulong
get_max_connections
(
void
);
#endif
sql/mysqld.cc
View file @
715d404e
...
...
@@ -4895,6 +4895,14 @@ static bool read_init_file(char *file_name)
}
/**
Increment number of created threads
*/
void
inc_thread_created
(
void
)
{
thread_created
++
;
}
#ifndef EMBEDDED_LIBRARY
/*
...
...
sql/sql_class.cc
View file @
715d404e
...
...
@@ -433,6 +433,38 @@ void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var)
thd
->
set_mysys_var
(
mysys_var
);
}
/**
Get socket file descriptor for this connection
@param thd THD object
@retval Socket of the connection
*/
my_socket
thd_get_fd
(
THD
*
thd
)
{
return
thd
->
net
.
vio
->
sd
;
}
/**
Get thread attributes for connection threads
@retval Reference to thread attribute for connection threads
*/
pthread_attr_t
*
get_connection_attrib
(
void
)
{
return
&
connection_attrib
;
}
/**
Get max number of connections
@retval Max number of connections for MySQL Server
*/
ulong
get_max_connections
(
void
)
{
return
max_connections
;
}
/*
The following functions form part of the C plugin API
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment