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
0e6dd671
Commit
0e6dd671
authored
Feb 10, 2012
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for lp:910817: Race condition in kill_threads_for_user().
parents
804c69ab
3d61c139
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
sql/sql_parse.cc
sql/sql_parse.cc
+13
-3
No files found.
sql/sql_parse.cc
View file @
0e6dd671
...
...
@@ -6674,13 +6674,23 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user,
if
(
!
threads_to_kill
.
is_empty
())
{
List_iterator_fast
<
THD
>
it
(
threads_to_kill
);
THD
*
ptr
;
while
((
ptr
=
it
++
))
THD
*
next_ptr
;
THD
*
ptr
=
it
++
;
do
{
ptr
->
awake
(
kill_signal
);
/*
Careful here: The list nodes are allocated on the memroots of the
THDs to be awakened.
But those THDs may be terminated and deleted as soon as we release
LOCK_thd_data, which will make the list nodes invalid.
Since the operation "it++" dereferences the "next" pointer of the
previous list node, we need to do this while holding LOCK_thd_data.
*/
next_ptr
=
it
++
;
mysql_mutex_unlock
(
&
ptr
->
LOCK_thd_data
);
(
*
rows
)
++
;
}
}
while
((
ptr
=
next_ptr
));
}
DBUG_RETURN
(
0
);
}
...
...
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