[MDEV-5134] emb_free_embedded_thd is not thread safe Created: 2013-10-14  Updated: 2013-10-16  Due: 2013-10-28  Resolved: 2013-10-16

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.33
Fix Version/s: 5.5.34

Type: Bug Priority: Major
Reporter: Vilho Raatikka Assignee: Alexey Botchkov
Resolution: Duplicate Votes: 0
Labels: None


 Description   

static void emb_free_embedded_thd(MYSQL *mysql)
{
THD thd= (THD)mysql->thd;
thd->clear_data_list();
thread_count--;
thd->store_globals();
thd->unlink();
delete thd;
my_pthread_setspecific_ptr(THR_THD, 0);
mysql->thd=0;
}

thread_count is global but it is modified without protection. In a multi-core env this will lead to lost updates or at least, race conditions.



 Comments   
Comment by Alexey Botchkov [ 2013-10-16 ]

As I understand that was closed as a part of this one:
https://mariadb.atlassian.net/browse/MDEV-5131

Generated at Thu Feb 08 07:01:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.