-
Sergey Vojtovich authored
An addition to fix for MDEV-5205, fixes server crash on shutdown. Thread groups are destroyed asynchronously, that is kill server thread sends shutdown request to all thread groups without waiting for compeltion. It means all_groups array must not be freed until all thread groups are down. This patch suggests that all_groups is freed when last thread group is destroyed. Note 1: threadpool code doesn't surround atomic ops with atomic locks, thus no locks for shutdown_group_count. Note 2: this patch preserves old behaviour, but we may need to wait until all thread groups are down before returning from tp_end().
a588de1f