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
35e713dc
Commit
35e713dc
authored
Mar 09, 2016
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix leak from missing my_thread_end
parent
351026ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
sql/threadpool.h
sql/threadpool.h
+0
-1
sql/threadpool_common.cc
sql/threadpool_common.cc
+7
-16
No files found.
sql/threadpool.h
View file @
35e713dc
...
@@ -27,7 +27,6 @@ extern uint threadpool_oversubscribe; /* Maximum active threads in group */
...
@@ -27,7 +27,6 @@ extern uint threadpool_oversubscribe; /* Maximum active threads in group */
/* Common thread pool routines, suitable for different implementations */
/* Common thread pool routines, suitable for different implementations */
extern
void
threadpool_cleanup_connection
(
THD
*
thd
);
extern
void
threadpool_remove_connection
(
THD
*
thd
);
extern
void
threadpool_remove_connection
(
THD
*
thd
);
extern
int
threadpool_process_request
(
THD
*
thd
);
extern
int
threadpool_process_request
(
THD
*
thd
);
extern
THD
*
threadpool_add_connection
(
CONNECT
*
connect
,
void
*
scheduled_data
);
extern
THD
*
threadpool_add_connection
(
CONNECT
*
connect
,
void
*
scheduled_data
);
...
...
sql/threadpool_common.cc
View file @
35e713dc
...
@@ -182,27 +182,13 @@ THD* threadpool_add_connection(CONNECT *connect, void *scheduler_data)
...
@@ -182,27 +182,13 @@ THD* threadpool_add_connection(CONNECT *connect, void *scheduler_data)
}
}
if
(
error
)
if
(
error
)
{
{
threadpool_
cleanup
_connection
(
thd
);
threadpool_
remove
_connection
(
thd
);
thd
=
NULL
;
thd
=
NULL
;
}
}
worker_context
.
restore
();
worker_context
.
restore
();
return
thd
;
return
thd
;
}
}
/*
threadpool_cleanup_connection() does the bulk of connection shutdown work.
Usually called from threadpool_remove_connection(), but rarely it might
be called also in the main polling thread if connection initialization fails.
*/
void
threadpool_cleanup_connection
(
THD
*
thd
)
{
thd
->
net
.
reading_or_writing
=
0
;
end_connection
(
thd
);
close_connection
(
thd
,
0
);
unlink_thd
(
thd
);
mysql_cond_broadcast
(
&
COND_thread_count
);
}
void
threadpool_remove_connection
(
THD
*
thd
)
void
threadpool_remove_connection
(
THD
*
thd
)
{
{
...
@@ -210,7 +196,12 @@ void threadpool_remove_connection(THD *thd)
...
@@ -210,7 +196,12 @@ void threadpool_remove_connection(THD *thd)
worker_context
.
save
();
worker_context
.
save
();
thread_attach
(
thd
);
thread_attach
(
thd
);
threadpool_cleanup_connection
(
thd
);
thd
->
net
.
reading_or_writing
=
0
;
end_connection
(
thd
);
close_connection
(
thd
,
0
);
unlink_thd
(
thd
);
mysql_cond_broadcast
(
&
COND_thread_count
);
/*
/*
Free resources associated with this connection:
Free resources associated with this connection:
mysys thread_var and PSI thread.
mysys thread_var and PSI thread.
...
...
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