| 755 | } |
| 756 | |
| 757 | void add_global_thread(THD *thd) |
| 758 | { |
| 759 | DBUG_PRINT("info", ("add_global_thread %p", thd)); |
| 760 | mysql_mutex_assert_owner(&LOCK_thread_count); |
| 761 | const bool have_thread= |
| 762 | global_thread_list->find(thd) != global_thread_list->end(); |
| 763 | if (!have_thread) |
| 764 | { |
| 765 | ++global_thread_count; |
| 766 | global_thread_list->insert(thd); |
| 767 | } |
| 768 | // Adding the same THD twice is an error. |
| 769 | DBUG_ASSERT(!have_thread); |
| 770 | } |
| 771 | |
| 772 | void remove_global_thread(THD *thd) |
| 773 | { |