summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2020-03-27 02:13:41 +0400
committerSergey Vojtovich <svoj@mariadb.org>2020-03-27 02:17:40 +0400
commite91a3ea73284c53acda86b8bcaa02e8c92cbbf2e (patch)
tree72b05fd4a7594e42e663bb8a0d015de6b02d151c
parented8bf7c98f381cad8237176898d936f38bba17ea (diff)
downloadmariadb-git-e91a3ea73284c53acda86b8bcaa02e8c92cbbf2e.tar.gz
shutdown_group_count my_atomic to Atomic_counter
-rw-r--r--sql/threadpool_generic.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index c3ca38212f2..786fb5659c8 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -200,7 +200,7 @@ struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) thread_group_t
static thread_group_t *all_groups;
static uint group_count;
-static int32 shutdown_group_count;
+static Atomic_counter<uint32_t> shutdown_group_count;
/**
Used for printing "pool blocked" message, see
@@ -1068,7 +1068,7 @@ void thread_group_destroy(thread_group_t *thread_group)
}
#endif
- if (my_atomic_add32(&shutdown_group_count, -1) == 1)
+ if (!--shutdown_group_count)
my_free(all_groups);
}