1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

merge from 5.5

This commit is contained in:
Vladislav Vaintroub
2012-02-16 17:33:37 +01:00
202 changed files with 6684 additions and 3439 deletions

View File

@ -6676,13 +6676,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);
}