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
215ce05a
Commit
215ce05a
authored
May 18, 2011
by
Mikael Ronström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split up unlink_thd in several functions
parent
ecb3814b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
include/mysql/thread_pool_priv.h
include/mysql/thread_pool_priv.h
+3
-1
sql/mysqld.cc
sql/mysqld.cc
+32
-7
No files found.
include/mysql/thread_pool_priv.h
View file @
215ce05a
...
@@ -94,8 +94,10 @@ bool thd_is_connection_alive(THD *thd);
...
@@ -94,8 +94,10 @@ bool thd_is_connection_alive(THD *thd);
void
close_connection
(
THD
*
thd
,
uint
errcode
);
void
close_connection
(
THD
*
thd
,
uint
errcode
);
/* End the connection before closing it */
/* End the connection before closing it */
void
end_connection
(
THD
*
thd
);
void
end_connection
(
THD
*
thd
);
/* Decrement connection counter */
void
dec_connection_count
();
/* Destroy THD object */
/* Destroy THD object */
void
unlink
_thd
(
THD
*
thd
);
void
delete
_thd
(
THD
*
thd
);
/*
/*
thread_created is maintained by thread pool when activated since
thread_created is maintained by thread pool when activated since
...
...
sql/mysqld.cc
View file @
215ce05a
...
@@ -2009,6 +2009,36 @@ extern "C" sig_handler end_thread_signal(int sig __attribute__((unused)))
...
@@ -2009,6 +2009,36 @@ extern "C" sig_handler end_thread_signal(int sig __attribute__((unused)))
}
}
/*
Decrease number of connections
SYNOPSIS
dec_connection_count()
*/
void
dec_connection_count
()
{
mysql_mutex_lock
(
&
LOCK_connection_count
);
--
connection_count
;
mysql_mutex_unlock
(
&
LOCK_connection_count
);
}
/*
Delete the THD object and decrease number of threads
SYNOPSIS
delete_thd()
thd Thread handler
*/
void
delete_thd
(
THD
*
thd
)
{
thread_count
--
;
delete
thd
;
}
/*
/*
Unlink thd from global list of available connections and free thd
Unlink thd from global list of available connections and free thd
...
@@ -2024,15 +2054,10 @@ void unlink_thd(THD *thd)
...
@@ -2024,15 +2054,10 @@ void unlink_thd(THD *thd)
{
{
DBUG_ENTER
(
"unlink_thd"
);
DBUG_ENTER
(
"unlink_thd"
);
DBUG_PRINT
(
"enter"
,
(
"thd: 0x%lx"
,
(
long
)
thd
));
DBUG_PRINT
(
"enter"
,
(
"thd: 0x%lx"
,
(
long
)
thd
));
thd
->
cleanup
();
mysql_mutex_lock
(
&
LOCK_connection_count
);
--
connection_count
;
mysql_mutex_unlock
(
&
LOCK_connection_count
);
dec_connection_count
();
mysql_mutex_lock
(
&
LOCK_thread_count
);
mysql_mutex_lock
(
&
LOCK_thread_count
);
thread_count
--
;
delete_thd
(
thd
);
delete
thd
;
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
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